[gnome-software] trivial: Never notify about updates when there are none
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Never notify about updates when there are none
- Date: Fri, 3 Jun 2016 07:56:57 +0000 (UTC)
commit 78ef62038ee955de64c573ddd5e6d3b0f0104229
Author: Richard Hughes <richard hughsie com>
Date: Fri Jun 3 08:56:24 2016 +0100
trivial: Never notify about updates when there are none
This is fallout from GsAppList.
src/gs-update-monitor.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index 3b884e1..e486933 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -164,11 +164,16 @@ get_updates_finished_cb (GObject *object,
/* get result */
apps = gs_plugin_loader_get_updates_finish (GS_PLUGIN_LOADER (object), res, &error);
if (apps == NULL) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ g_warning ("failed to get updates: %s", error->message);
+ return;
+ }
+
+ /* no updates */
+ if (gs_app_list_length (apps) == 0) {
g_debug ("no updates; withdrawing updates-available notification");
g_application_withdraw_notification (monitor->application,
"updates-available");
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_warning ("failed to get updates: %s", error->message);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]