gnome-settings-daemon r286 - in trunk: . plugins/background
- From: jensg svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-settings-daemon r286 - in trunk: . plugins/background
- Date: Thu, 10 Apr 2008 20:12:51 +0100 (BST)
Author: jensg
Date: Thu Apr 10 20:12:50 2008
New Revision: 286
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=286&view=rev
Log:
2008-04-10 Jens Granseuer <jensgr gmx net>
Make background plugin deactivation work
* plugins/background/gsd-background-manager.c:
(gsd_background_manager_start), (gsd_background_manager_stop):
clean up properly on stop
* plugins/background/gsd-background-plugin.c: (impl_deactivate):
stop manager on deactivation
Modified:
trunk/ChangeLog
trunk/plugins/background/gsd-background-manager.c
trunk/plugins/background/gsd-background-plugin.c
Modified: trunk/plugins/background/gsd-background-manager.c
==============================================================================
--- trunk/plugins/background/gsd-background-manager.c (original)
+++ trunk/plugins/background/gsd-background-manager.c Thu Apr 10 20:12:50 2008
@@ -48,11 +48,14 @@
#define GSD_BACKGROUND_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_BACKGROUND_MANAGER, GsdBackgroundManagerPrivate))
+#define GCONF_BG_DIR "/desktop/gnome/background"
+
struct GsdBackgroundManagerPrivate
{
BGPreferences *prefs;
GnomeBG *bg;
guint timeout_id;
+ guint notify;
};
static void gsd_background_manager_class_init (GsdBackgroundManagerClass *klass);
@@ -292,12 +295,13 @@
bg_preferences_load (manager->priv->prefs);
client = gconf_client_get_default ();
- gconf_client_notify_add (client,
- "/desktop/gnome/background",
- (GConfClientNotifyFunc) background_callback,
- manager,
- NULL,
- NULL);
+ gconf_client_add_dir (client, GCONF_BG_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);
+ manager->priv->notify = gconf_client_notify_add (client,
+ GCONF_BG_DIR,
+ (GConfClientNotifyFunc) background_callback,
+ manager,
+ NULL,
+ NULL);
/* If this is set, nautilus will draw the background and is
* almost definitely in our session. however, it may not be
@@ -323,16 +327,31 @@
void
gsd_background_manager_stop (GsdBackgroundManager *manager)
{
+ GsdBackgroundManagerPrivate *p = manager->priv;
+
g_debug ("Stopping background manager");
- if (manager->priv->prefs != NULL) {
- g_object_unref (manager->priv->prefs);
- manager->priv->prefs = NULL;
+ if (p->notify != 0) {
+ GConfClient *client = gconf_client_get_default ();
+ gconf_client_remove_dir (client, GCONF_BG_DIR, NULL);
+ gconf_client_notify_remove (client, p->notify);
+ g_object_unref (client);
+ p->notify = 0;
+ }
+
+ if (p->timeout_id != 0) {
+ g_source_remove (p->timeout_id);
+ p->timeout_id = 0;
+ }
+
+ if (p->prefs != NULL) {
+ g_object_unref (p->prefs);
+ p->prefs = NULL;
}
- if (manager->priv->bg != NULL) {
- g_object_unref (manager->priv->bg);
- manager->priv->bg = NULL;
+ if (p->bg != NULL) {
+ g_object_unref (p->bg);
+ p->bg = NULL;
}
}
Modified: trunk/plugins/background/gsd-background-plugin.c
==============================================================================
--- trunk/plugins/background/gsd-background-plugin.c (original)
+++ trunk/plugins/background/gsd-background-plugin.c Thu Apr 10 20:12:50 2008
@@ -86,6 +86,7 @@
impl_deactivate (GnomeSettingsPlugin *plugin)
{
g_debug ("Deactivating background plugin");
+ gsd_background_manager_stop (GSD_BACKGROUND_PLUGIN (plugin)->priv->manager);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]