[gnome-software/gnome-3-12] update monitor: Split out a function



commit 06f4dbda7459e09734cafd8bedfa044d76641f3f
Author: Kalev Lember <kalevlember gmail com>
Date:   Thu Apr 10 23:17:26 2014 +0200

    update monitor: Split out a function
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728000

 src/gs-update-monitor.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index e0ef43c..b085799 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -131,10 +131,9 @@ start_monitoring_offline_updates (GsUpdateMonitor *monitor)
         notify_offline_update_available (monitor);
 }
 
-static gboolean
-check_offline_update_cb (gpointer user_data)
+static void
+show_installed_updates_notification (GsUpdateMonitor *monitor)
 {
-       GsUpdateMonitor *monitor = user_data;
        const gchar *message;
        const gchar *title;
        gboolean success;
@@ -143,7 +142,7 @@ check_offline_update_cb (gpointer user_data)
        GIcon *icon;
 
        if (!gs_offline_updates_get_status (&success, &num_packages, NULL, NULL))
-               goto out;
+               return;
 
        if (success) {
                guint64 time_completed;
@@ -180,8 +179,14 @@ check_offline_update_cb (gpointer user_data)
 
        g_application_send_notification (monitor->application, "offline-updates", notification);
        g_object_unref (notification);
+}
+
+static gboolean
+check_offline_update_cb (gpointer user_data)
+{
+       GsUpdateMonitor *monitor = user_data;
 
-out:
+       show_installed_updates_notification (monitor);
        start_monitoring_offline_updates (monitor);
 
         monitor->check_offline_update_id = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]