[evolution/wip/gsettings: 20/29] Port misc widgets to use GSettings



commit 93f489a9a4bebc6b1f2331ba2aa5804669b41a9a
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Thu Oct 13 13:55:54 2011 +0200

    Port misc widgets to use GSettings

 data/org.gnome.evolution.mail.gschema.xml.in |    2 +-
 widgets/misc/e-attachment-paned.c            |   14 +++++---------
 widgets/misc/e-attachment-store.c            |    1 -
 widgets/misc/e-attachment.c                  |   14 ++++++--------
 4 files changed, 12 insertions(+), 19 deletions(-)
---
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in
index c1352be..c52c76c 100644
--- a/data/org.gnome.evolution.mail.gschema.xml.in
+++ b/data/org.gnome.evolution.mail.gschema.xml.in
@@ -5,7 +5,7 @@
       <_summary>Check whether Evolution is the default mailer</_summary>
       <_description>Every time Evolution starts, check whether or not it is the default mailer.</_description>
     </key>
-    <key name="composer-charser" type="s">
+    <key name="composer-charset" type="s">
       <default>''</default>
       <_summary>Default charset in which to compose messages</_summary>
       <_description>Default charset in which to compose messages.</_description>
diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c
index 2903c84..c5fb9b4 100644
--- a/widgets/misc/e-attachment-paned.c
+++ b/widgets/misc/e-attachment-paned.c
@@ -27,8 +27,6 @@
 
 #include <glib/gi18n.h>
 
-#include "e-util/gconf-bridge.h"
-
 #include "e-attachment-view.h"
 #include "e-attachment-store.h"
 #include "e-attachment-icon-view.h"
@@ -346,12 +344,11 @@ static void
 attachment_paned_constructed (GObject *object)
 {
 	EAttachmentPanedPrivate *priv;
-	GConfBridge *bridge;
-	const gchar *key;
+	GSettings *settings;
 
 	priv = E_ATTACHMENT_PANED (object)->priv;
 
-	bridge = gconf_bridge_get ();
+	settings = g_settings_new ("org.gnome.evolution.shell");
 
 	/* Set up property-to-property bindings. */
 
@@ -409,10 +406,9 @@ attachment_paned_constructed (GObject *object)
 		G_BINDING_BIDIRECTIONAL |
 		G_BINDING_SYNC_CREATE);
 
-	/* Set up property-to-GConf bindings. */
-
-	key = "/apps/evolution/shell/attachment_view";
-	gconf_bridge_bind_property (bridge, key, object, "active-view");
+	/* Set up property-to-GSettings bindings. */
+	g_settings_bind (settings, "attachment-view", object, "active-view", G_SETTINGS_BIND_DEFAULT);
+	g_object_unref (settings);
 
 	/* Chain up to parent's constructed() method. */
 	G_OBJECT_CLASS (e_attachment_paned_parent_class)->constructed (object);
diff --git a/widgets/misc/e-attachment-store.c b/widgets/misc/e-attachment-store.c
index 8c808d9..c6208b6 100644
--- a/widgets/misc/e-attachment-store.c
+++ b/widgets/misc/e-attachment-store.c
@@ -30,7 +30,6 @@
 
 #include "e-util/e-util.h"
 #include "e-util/e-mktemp.h"
-#include "e-util/gconf-bridge.h"
 
 struct _EAttachmentStorePrivate {
 	GHashTable *attachment_index;
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 4174fe9..1660205 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -153,25 +153,23 @@ create_system_thumbnail (EAttachment *attachment,
 static gchar *
 attachment_get_default_charset (void)
 {
-	GConfClient *client;
-	const gchar *key;
+	GSettings *settings;
 	gchar *charset;
 
 	/* XXX This doesn't really belong here. */
 
-	client = gconf_client_get_default ();
-	key = "/apps/evolution/mail/composer/charset";
-	charset = gconf_client_get_string (client, key, NULL);
+	settings = g_settings_new ("org.gnome.evolution.mail");
+	charset = g_settings_get_string (settings, "composer-charset");
 	if (charset == NULL || *charset == '\0') {
 		g_free (charset);
-		key = "/apps/evolution/mail/format/charset";
-		charset = gconf_client_get_string (client, key, NULL);
+		/* FIXME: this was "/apps/evolution/mail/format/charset", not sure it relates to "charset" */
+		charset = g_settings_get_string (settings, "charset");
 		if (charset == NULL || *charset == '\0') {
 			g_free (charset);
 			charset = NULL;
 		}
 	}
-	g_object_unref (client);
+	g_object_unref (settings);
 
 	if (charset == NULL)
 		charset = g_strdup (camel_iconv_locale_charset ());



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