[rhythmbox] status-icon: check widgets exist before updating them for gconf changes



commit d231afc868b8a9aff40deeec3add32a7e73a7875
Author: Jonathan Matthew <jonathan d14n org>
Date:   Fri Jun 19 23:37:32 2009 +1000

    status-icon: check widgets exist before updating them for gconf changes

 plugins/status-icon/rb-status-icon-plugin.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/plugins/status-icon/rb-status-icon-plugin.c b/plugins/status-icon/rb-status-icon-plugin.c
index 6b797c5..ed5996e 100644
--- a/plugins/status-icon/rb-status-icon-plugin.c
+++ b/plugins/status-icon/rb-status-icon-plugin.c
@@ -1140,9 +1140,11 @@ config_notify_cb (GConfClient *client, guint connection_id, GConfEntry *entry, R
 		update_status_icon_visibility (plugin, FALSE);	/* maybe should remember if we're notifying.. */
 		sync_actions (plugin);
 
-		plugin->priv->syncing_config_widgets = TRUE;
-		gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->icon_combo), plugin->priv->icon_mode);
-		plugin->priv->syncing_config_widgets = FALSE;
+		if (plugin->priv->icon_combo != NULL) {
+			plugin->priv->syncing_config_widgets = TRUE;
+			gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->icon_combo), plugin->priv->icon_mode);
+			plugin->priv->syncing_config_widgets = FALSE;
+		}
 
 	} else if (g_str_equal (gconf_entry_get_key (entry), CONF_NOTIFICATION_MODE)) {
 		plugin->priv->notify_mode = gconf_value_get_int (gconf_entry_get_value (entry));
@@ -1150,9 +1152,11 @@ config_notify_cb (GConfClient *client, guint connection_id, GConfEntry *entry, R
 
 		sync_actions (plugin);
 
-		plugin->priv->syncing_config_widgets = TRUE;
-		gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->notify_combo), plugin->priv->notify_mode);
-		plugin->priv->syncing_config_widgets = FALSE;
+		if (plugin->priv->notify_combo != NULL) {
+			plugin->priv->syncing_config_widgets = TRUE;
+			gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->notify_combo), plugin->priv->notify_mode);
+			plugin->priv->syncing_config_widgets = FALSE;
+		}
 	}
 }
 



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