[network-manager-applet/dcbw/indicator-cleanups] fixup! applet: allow indicator and status icon to be built together



commit 1fbe1b447edbf993d9aa7555fcffc074dd718979
Author: Thomas Haller <thaller redhat com>
Date:   Wed Mar 16 10:52:39 2016 +0100

    fixup! applet: allow indicator and status icon to be built together

 src/applet.c |    8 +++-----
 src/applet.h |    2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 4aa0e89..380bd85 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -2000,8 +2000,8 @@ applet_add_default_connection_item (NMDevice *device,
 static gboolean
 applet_update_indicator_menu (gpointer user_data)
 {
-#ifdef WITH_INDICATOR
        NMApplet *applet = NM_APPLET (user_data);
+#ifdef WITH_INDICATOR
        GtkWidget *menu;
 
        menu = nma_context_menu_create (applet);
@@ -2010,10 +2010,9 @@ applet_update_indicator_menu (gpointer user_data)
        nma_context_menu_update (applet);
 
        app_indicator_set_menu (applet->app_indicator, GTK_MENU (menu));
-
-       applet->update_menu_id = 0;
 #endif /* WITH_INDICATOR */
 
+       applet->update_menu_id = 0;
        return G_SOURCE_REMOVE;
 }
 
@@ -3286,9 +3285,8 @@ static void finalize (GObject *object)
 
 #ifdef WITH_INDICATOR
        g_clear_object (&applet->app_indicator);
-       if (applet->update_menu_id)
-               g_source_remove (applet->update_menu_id);
 #endif /* WITH_INDICATOR */
+       nm_clear_g_source (&applet->update_menu_id);
 
        g_clear_object (&applet->status_icon);
        g_clear_object (&applet->menu);
diff --git a/src/applet.h b/src/applet.h
index 5744322..25b7b7d 100644
--- a/src/applet.h
+++ b/src/applet.h
@@ -119,8 +119,8 @@ typedef struct {
        /* Direct UI elements */
 #ifdef WITH_INDICATOR
        AppIndicator *  app_indicator;
-       guint           update_menu_id;
 #endif
+       guint           update_menu_id;
 
        GtkStatusIcon * status_icon;
 


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