aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-11-04 22:55:21 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-11-04 22:55:21 +0800
commit80b0ca6849fd7b09a81a445771ae4ec64610ba18 (patch)
treef0feb9b2d362d65503d036d3d53521360dec6ed2
parent48b565039b8a442ec4b5d8602e3d5e43399684f8 (diff)
downloadgsoc2013-evolution-80b0ca6849fd7b09a81a445771ae4ec64610ba18.tar
gsoc2013-evolution-80b0ca6849fd7b09a81a445771ae4ec64610ba18.tar.gz
gsoc2013-evolution-80b0ca6849fd7b09a81a445771ae4ec64610ba18.tar.bz2
gsoc2013-evolution-80b0ca6849fd7b09a81a445771ae4ec64610ba18.tar.lz
gsoc2013-evolution-80b0ca6849fd7b09a81a445771ae4ec64610ba18.tar.xz
gsoc2013-evolution-80b0ca6849fd7b09a81a445771ae4ec64610ba18.tar.zst
gsoc2013-evolution-80b0ca6849fd7b09a81a445771ae4ec64610ba18.zip
Migrate itip formatter to GSettings
-rw-r--r--data/Makefile.am1
-rw-r--r--data/evolution.convert3
-rw-r--r--data/org.gnome.evolution.eplugin.itip.gschema.xml.in9
-rw-r--r--plugins/itip-formatter/itip-formatter.c15
-rw-r--r--plugins/itip-formatter/itip-view.c1
5 files changed, 20 insertions, 9 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 567b9be8b2..4a4cc278d2 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -22,6 +22,7 @@ gsettings_SCHEMAS = \
org.gnome.evolution.eplugin.email-custom-header.gschema.xml \
org.gnome.evolution.eplugin.external-editor.gschema.xml \
org.gnome.evolution.eplugin.face-picture.gschema.xml \
+ org.gnome.evolution.eplugin.itip.gschema.xml \
org.gnome.evolution.eplugin.mail-notification.gschema.xml \
org.gnome.evolution.eplugin.prefer-plain.gschema.xml.in \
org.gnome.evolution.eplugin.templates.gschema.xml
diff --git a/data/evolution.convert b/data/evolution.convert
index 61b697412e..6946b0eab3 100644
--- a/data/evolution.convert
+++ b/data/evolution.convert
@@ -215,6 +215,9 @@ launch-on-key-press = /apps/evolution/eplugin/external-editor/launch-on-key-pres
[org.gnome.evolution.eplugin.face-picture]
insert-face-picture = /apps/evolution/eplugin/face/insert_by_default
+[org.gnome.evolution.eplugin.itip]
+delete-processed = /apps/evolution/itip/delete_processed
+
[org.gnome.evolution.eplugin.mail-notification]
notify-dbus-enabled = /apps/evolution/eplugin/mail-notification/dbus-enabled
notify-only-inbox = /apps/evolution/eplugin/mail-notification/notify-only-inbox
diff --git a/data/org.gnome.evolution.eplugin.itip.gschema.xml.in b/data/org.gnome.evolution.eplugin.itip.gschema.xml.in
new file mode 100644
index 0000000000..5e0e1d4567
--- /dev/null
+++ b/data/org.gnome.evolution.eplugin.itip.gschema.xml.in
@@ -0,0 +1,9 @@
+<schemalist>
+ <schema gettext-domain="evolution" id="org.gnome.evolution.eplugin.itip" path="/org/gnome/evolution/eplugin/itip/">
+ <key name="delete-processed" type="b">
+ <default>false</default>
+ <_summary>Delete processed</_summary>
+ <_description>Whether to delete processed iTip objects</_description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 72535a3a99..d9ec622f6e 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -27,7 +27,6 @@
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
#include <libecal/e-cal-client.h>
#include <libecal/e-cal-time-util.h>
#include <libedataserverui/e-source-selector.h>
@@ -51,7 +50,7 @@
#include <misc/e-attachment.h>
#define CLASSID "itip://"
-#define GCONF_KEY_DELETE "/apps/evolution/itip/delete_processed"
+#define CONF_KEY_DELETE "delete-processed"
#define d(x)
@@ -2888,7 +2887,7 @@ void
format_itip (EPlugin *ep,
EMFormatHookTarget *target)
{
- GConfClient *gconf;
+ GSettings *settings;
gchar *classid;
struct _itip_puri *puri;
CamelDataWrapper *content;
@@ -2907,8 +2906,8 @@ format_itip (EPlugin *ep,
em_format_html_add_pobject ((EMFormatHTML *) target->format, sizeof (EMFormatHTMLPObject), classid, target->part, format_itip_object);
- gconf = gconf_client_get_default ();
- puri->delete_message = gconf_client_get_bool (gconf, GCONF_KEY_DELETE, NULL);
+ settings = g_settings_new ("org.gnome.evolution.eplugin.itip");
+ puri->delete_message = g_settings_get_boolean (settings, CONF_KEY_DELETE);
puri->has_organizer = FALSE;
puri->no_reply_wanted = FALSE;
puri->folder = ((EMFormat *) target->format)->folder;
@@ -2918,7 +2917,7 @@ format_itip (EPlugin *ep,
puri->cancellable = g_cancellable_new ();
puri->puri.free = puri_free;
- g_object_unref (gconf);
+ g_object_unref (settings);
/* This is non-gui thread. Download the part for using in the main thread */
content = camel_medium_get_content ((CamelMedium *) target->part);
@@ -2952,7 +2951,7 @@ delete_toggled_cb (GtkWidget *widget,
{
EMConfigTargetPrefs *target = data;
- gconf_client_set_bool (target->gconf, GCONF_KEY_DELETE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)), NULL);
+ g_settings_set_boolean (target->settings, CONF_KEY_DELETE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
}
static void
@@ -3053,7 +3052,7 @@ itip_formatter_page_factory (EPlugin *ep,
/* Delete message after acting */
/* FIXME Need a schema for this */
check = gtk_check_button_new_with_mnemonic (_("_Delete message after acting"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gconf_client_get_bool (target->gconf, GCONF_KEY_DELETE, NULL));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), g_settings_get_boolean (target->settings, CONF_KEY_DELETE));
g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (delete_toggled_cb), target);
gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0);
diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c
index 5163d25e02..fd4190b593 100644
--- a/plugins/itip-formatter/itip-view.c
+++ b/plugins/itip-formatter/itip-view.c
@@ -26,7 +26,6 @@
#include <string.h>
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
#include <libedataserver/e-time-utils.h>
#include <libedataserver/e-data-server-util.h>
#include <libedataserverui/e-source-combo-box.h>