diff options
author | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-10-14 18:25:34 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-10-14 18:25:34 +0800 |
commit | 3dc5ac02b4acf762c22a2f1980facdd0d01d678e (patch) | |
tree | 6b6dac0ff4818cd05f75920320a3d0e507bf2302 /plugins | |
parent | 3e2efde8299cda56382dfc8f3457f302048a89a6 (diff) | |
download | gsoc2013-evolution-3dc5ac02b4acf762c22a2f1980facdd0d01d678e.tar.gz gsoc2013-evolution-3dc5ac02b4acf762c22a2f1980facdd0d01d678e.tar.zst gsoc2013-evolution-3dc5ac02b4acf762c22a2f1980facdd0d01d678e.zip |
Migrate prefer-plain plugin to GSettings
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/prefer-plain/prefer-plain.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c index 55f62f8e3d..907e562c29 100644 --- a/plugins/prefer-plain/prefer-plain.c +++ b/plugins/prefer-plain/prefer-plain.c @@ -26,7 +26,6 @@ #include <gtk/gtk.h> #include <glib/gi18n-lib.h> -#include <gconf/gconf-client.h> #include <string.h> #include <stdio.h> @@ -44,7 +43,7 @@ enum { EPP_TEXT }; -static GConfClient *epp_gconf = NULL; +static GSettings *epp_settings = NULL; static gint epp_mode = -1; static gboolean epp_show_suppressed = TRUE; @@ -281,7 +280,7 @@ epp_mode_changed (GtkComboBox *dropdown, if (epp_mode > 2) epp_mode = 0; - gconf_client_set_string(epp_gconf, "/apps/evolution/eplugin/prefer_plain/mode", epp_options[epp_mode].key, NULL); + g_settings_set_string (epp_settings, "mode", epp_options[epp_mode].key); update_info_label (info_label, epp_mode); } @@ -292,7 +291,7 @@ epp_show_suppressed_toggled (GtkToggleButton *check, g_return_if_fail (check != NULL); epp_show_suppressed = gtk_toggle_button_get_active (check); - gconf_client_set_bool (epp_gconf, "/apps/evolution/eplugin/prefer_plain/show_suppressed", epp_show_suppressed, NULL); + g_settings_set_boolean (epp_settings, "show-suppressed", epp_show_suppressed); } GtkWidget * @@ -363,14 +362,13 @@ e_plugin_lib_enable (EPlugin *ep, gchar *key; gint i; - if (epp_gconf || epp_mode != -1) + if (epp_settings || epp_mode != -1) return 0; if (enable) { - GConfValue *val; - epp_gconf = gconf_client_get_default (); - key = gconf_client_get_string(epp_gconf, "/apps/evolution/eplugin/prefer_plain/mode", NULL); + epp_settings = g_settings_new ("org.gnome.evolution.eplugin.prefer-plain"); + key = g_settings_get_string (epp_settings, "mode"); if (key) { for (i = 0; i < G_N_ELEMENTS (epp_options); i++) { if (!strcmp (epp_options[i].key, key)) { @@ -383,16 +381,11 @@ e_plugin_lib_enable (EPlugin *ep, epp_mode = 0; } - val = gconf_client_get (epp_gconf, "/apps/evolution/eplugin/prefer_plain/show_suppressed", NULL); - if (val) { - epp_show_suppressed = gconf_value_get_bool (val); - gconf_value_free (val); - } else - epp_show_suppressed = TRUE; + epp_show_suppressed = g_settings_get_boolean (epp_settings, "show-suppressed"); } else { - if (epp_gconf) { - g_object_unref (epp_gconf); - epp_gconf = NULL; + if (epp_settings) { + g_object_unref (epp_settings); + epp_settings = NULL; } } |