diff options
author | Milan Crha <mcrha@redhat.com> | 2012-06-15 15:04:08 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-06-15 15:04:08 +0800 |
commit | 94daae3dba8e86e88f69320bc82795fe660ec9cd (patch) | |
tree | 9965d4f6dfc6d48adecd0b9084442185d73d58c7 /plugins | |
parent | 08dedf0a8a520b55c51a8117dc015915ec39f7fe (diff) | |
download | gsoc2013-evolution-94daae3dba8e86e88f69320bc82795fe660ec9cd.tar.gz gsoc2013-evolution-94daae3dba8e86e88f69320bc82795fe660ec9cd.tar.zst gsoc2013-evolution-94daae3dba8e86e88f69320bc82795fe660ec9cd.zip |
Remove the last remaining usage of GConf
Diffstat (limited to 'plugins')
18 files changed, 157 insertions, 528 deletions
diff --git a/plugins/attachment-reminder/Makefile.am b/plugins/attachment-reminder/Makefile.am index f9801b7221..0339e01f9c 100644 --- a/plugins/attachment-reminder/Makefile.am +++ b/plugins/attachment-reminder/Makefile.am @@ -36,45 +36,12 @@ liborg_gnome_evolution_attachment_reminder_la_LIBADD = \ $(GNOME_PLATFORM_LIBS) \ $(GTKHTML_LIBS) -schemadir = $(GCONF_SCHEMA_FILE_DIR) -schema_in_files = apps-evolution-attachment-reminder.schemas.in -schema_DATA = $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - -if GCONF_SCHEMAS_INSTALL - -if OS_WIN32 -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - (echo set GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE); \ - echo $(GCONFTOOL) --makefile-install-rule $$p) >_temp.bat; \ - cmd /c _temp.bat; \ - rm _temp.bat; \ - done \ - fi -else -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ - $(GCONFTOOL) --makefile-install-rule $$p; \ - done \ - fi -endif - -endif - EXTRA_DIST = org-gnome-evolution-attachment-reminder.eplug.xml \ - org-gnome-attachment-reminder.error.xml \ - $(schema_in_files) + org-gnome-attachment-reminder.error.xml BUILT_SOURCES = org-gnome-evolution-attachment-reminder.eplug \ org-gnome-attachment-reminder.error CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = $(schema_DATA) - -include $(top_srcdir)/git.mk diff --git a/plugins/attachment-reminder/apps-evolution-attachment-reminder.schemas.in b/plugins/attachment-reminder/apps-evolution-attachment-reminder.schemas.in deleted file mode 100644 index e86ebf665d..0000000000 --- a/plugins/attachment-reminder/apps-evolution-attachment-reminder.schemas.in +++ /dev/null @@ -1,26 +0,0 @@ -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/evolution/mail/attachment_reminder_clues</key> - <applyto>/apps/evolution/mail/attachment_reminder_clues</applyto> - <owner>evolution-mail</owner> - <type>list</type> - <list_type>string</list_type> - - <!-- The following are the keywords used by the plugin to understand - whether the user wanted to send a attachment. The list can have any - number of strings.--> - - <default>[attachment,attaching,attached,enclosed]</default> - <locale name="C"> - <short>List of clues for the attachment reminder plugin to look for - in a message body</short> - <long> - List of clues for the attachment reminder plugin to look for - in a message body - </long> - </locale> - </schema> - </schemalist> -</gconfschemafile> - diff --git a/plugins/email-custom-header/Makefile.am b/plugins/email-custom-header/Makefile.am index 75574a3c2a..a8d601658e 100644 --- a/plugins/email-custom-header/Makefile.am +++ b/plugins/email-custom-header/Makefile.am @@ -32,42 +32,11 @@ liborg_gnome_email_custom_header_la_LIBADD = \ liborg_gnome_email_custom_header_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) -schemadir = $(GCONF_SCHEMA_FILE_DIR) -schema_in_files = apps_evolution_email_custom_header.schemas.in -schema_DATA = $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - -if GCONF_SCHEMAS_INSTALL - -if OS_WIN32 -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - (echo set GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE); \ - echo $(GCONFTOOL) --makefile-install-rule $$p) >_temp.bat; \ - cmd /c _temp.bat; \ - rm _temp.bat; \ - done \ - fi -else -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ - $(GCONFTOOL) --makefile-install-rule $$p; \ - done \ - fi -endif - -endif - ui_DATA = \ org-gnome-email-custom-header.ui EXTRA_DIST = \ org-gnome-email-custom-header.eplug.xml \ - $(schema_in_files) \ $(ui_DATA) BUILT_SOURCES = \ @@ -75,6 +44,5 @@ BUILT_SOURCES = \ $(error_i18n) CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = $(schema_DATA) -include $(top_srcdir)/git.mk diff --git a/plugins/email-custom-header/apps_evolution_email_custom_header.schemas.in b/plugins/email-custom-header/apps_evolution_email_custom_header.schemas.in deleted file mode 100644 index cb3bd97ce8..0000000000 --- a/plugins/email-custom-header/apps_evolution_email_custom_header.schemas.in +++ /dev/null @@ -1,17 +0,0 @@ -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/evolution/eplugin/email_custom_header/customHeader</key> - <applyto>/apps/evolution/eplugin/email_custom_header/customHeader</applyto> - <owner>evolution-eplugin</owner> - <type>list</type> - <list_type>string</list_type> - <default>[Security=Personal;Unclassified;Protected;InConfidence;Secret;Topsecret]</default> - <locale name="C"> - <short>List of Custom Headers</short> - <long>The key specifies the list of custom headers that you can add to an outgoing message. The format for specifying a Header and Header value is: Name of the custom header followed by "=" and the values separated by ";"</long> - </locale> - </schema> - </schemalist> -</gconfschemafile> - diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index c0428a83a3..a88bad4815 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -26,7 +26,6 @@ #include <string.h> #include <glib/gi18n.h> -#include <gconf/gconf-client.h> #include "mail/em-utils.h" #include "mail/em-event.h" #include "composer/e-msg-composer.h" @@ -35,18 +34,19 @@ #include "email-custom-header.h" #define d(x) -#define GCONF_KEY_CUSTOM_HEADER "/apps/evolution/eplugin/email_custom_header/customHeader" + +#define ECM_SETTINGS_ID "org.gnome.evolution.plugin.email-custom-header" +#define ECM_SETTINGS_KEY "custom-header" #define CUSTOM_HEADER_OPTIONS_DIALOG_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialogPrivate)) typedef struct { - GConfClient *gconf; - GtkWidget *treeview; - GtkWidget *header_add; - GtkWidget *header_edit; - GtkWidget *header_remove; + GtkWidget *treeview; + GtkWidget *header_add; + GtkWidget *header_edit; + GtkWidget *header_remove; GtkListStore *store; } ConfigData; @@ -197,11 +197,15 @@ epech_dialog_run (CustomHeaderOptionsDialog *mch, GtkWidget *parent) { CustomHeaderOptionsDialogPrivate *priv; + GSettings *settings; GtkWidget *toplevel; g_return_val_if_fail (mch != NULL || EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (mch), FALSE); priv = mch->priv; - epech_get_header_list (mch); + + settings = g_settings_new (ECM_SETTINGS_ID); + epech_load_from_settings (settings, ECM_SETTINGS_KEY, mch); + g_object_unref (settings); priv->builder = gtk_builder_new (); e_load_ui_builder_definition ( @@ -228,41 +232,26 @@ epech_dialog_run (CustomHeaderOptionsDialog *mch, } static void -epech_get_header_list (CustomHeaderOptionsDialog *mch) -{ - GConfClient *client; - - client = gconf_client_get_default (); - g_return_if_fail (GCONF_IS_CLIENT (client)); - gconf_client_add_dir (client, GCONF_KEY_CUSTOM_HEADER, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - epech_load_from_gconf (client, "/apps/evolution/eplugin/email_custom_header/customHeader", mch); - - return; -} - -static void -epech_load_from_gconf (GConfClient *client, - const gchar *path, - CustomHeaderOptionsDialog *mch) +epech_load_from_settings (GSettings *settings, + const gchar *key, + CustomHeaderOptionsDialog *mch) { CustomHeaderOptionsDialogPrivate *priv; EmailCustomHeaderDetails temp_header_details= {-1, -1, NULL, NULL}; CustomSubHeader temp_header_value_details = {NULL}; - GSList *header_list,*q; - gchar *buffer; + gchar **headers; gint index,pos; priv = mch->priv; priv->email_custom_header_details = g_array_new (TRUE, TRUE, sizeof (EmailCustomHeaderDetails)); - header_list = gconf_client_get_list (client,path,GCONF_VALUE_STRING, NULL); + headers = g_settings_get_strv (settings, key); - for (q = header_list,pos = 0; q != NULL; q = q->next,pos++) { + for (pos = 0; headers && headers[pos]; pos++) { gchar **parse_header_list; - memset (&temp_header_value_details,0,sizeof (CustomSubHeader)); + memset (&temp_header_value_details, 0, sizeof (CustomSubHeader)); temp_header_details.sub_header_type_value = g_array_new (TRUE, TRUE, sizeof (CustomSubHeader)); - buffer = q->data; - parse_header_list = g_strsplit_set (buffer, "=;,", -1); + parse_header_list = g_strsplit_set (headers[pos], "=;,", -1); temp_header_details.header_type_value = g_string_new(""); if (temp_header_details.header_type_value) { g_string_assign (temp_header_details.header_type_value, parse_header_list[0]); @@ -283,6 +272,8 @@ epech_load_from_gconf (GConfClient *client, } temp_header_details.number_of_header = pos; + + g_strfreev (headers); } static void @@ -562,9 +553,12 @@ static void commit_changes (ConfigData *cd) { GtkTreeModel *model = NULL; - GSList *header_config_list = NULL; + GPtrArray *headers; GtkTreeIter iter; gboolean valid; + GSettings *settings; + + headers = g_ptr_array_new_full (3, g_free); model = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->treeview)); valid = gtk_tree_model_get_iter_first (model, &iter); @@ -580,9 +574,12 @@ commit_changes (ConfigData *cd) /* Check if the keyword is not empty */ if ((keyword) && (g_utf8_strlen (g_strstrip (keyword), -1) > 0)) { if ((value) && (g_utf8_strlen (g_strstrip (value), -1) > 0)) { + gchar *tmp = keyword; + keyword = g_strconcat (keyword, "=", value, NULL); + g_free (tmp); } - header_config_list = g_slist_append (header_config_list, g_strdup (keyword)); + g_ptr_array_add (headers, g_strdup (keyword)); } g_free (keyword); @@ -591,10 +588,13 @@ commit_changes (ConfigData *cd) valid = gtk_tree_model_iter_next (model, &iter); } - gconf_client_set_list (cd->gconf, GCONF_KEY_CUSTOM_HEADER, GCONF_VALUE_STRING, header_config_list, NULL); + g_ptr_array_add (headers, NULL); + + settings = g_settings_new (ECM_SETTINGS_ID); + g_settings_set_strv (settings, ECM_SETTINGS_KEY, (const gchar * const *) headers->pdata); + g_object_unref (settings); - g_slist_foreach (header_config_list, (GFunc) g_free, NULL); - g_slist_free (header_config_list); + g_ptr_array_free (headers, TRUE); } static void @@ -759,7 +759,6 @@ destroy_cd_data (gpointer data) if (!cd) return; - g_object_unref (cd->gconf); g_free (cd); } @@ -770,13 +769,11 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) GtkTreeSelection *selection; GtkTreeIter iter; GtkWidget *hbox; - GSList *list; - GSList *header_list = NULL; + gchar **headers; gint index; - gchar *buffer; GtkTreeViewColumn *col; gint col_pos; - GConfClient *client = gconf_client_get_default (); + GSettings *settings; ConfigData *cd = g_new0 (ConfigData, 1); GtkWidget *ech_configuration_box; @@ -844,8 +841,6 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_container_add (GTK_CONTAINER (vbuttonbox1), header_remove); gtk_widget_set_can_default (header_remove, TRUE); - cd->gconf = gconf_client_get_default (); - cd->treeview = header_treeview; cd->store = gtk_list_store_new (HEADER_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING); @@ -904,27 +899,29 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) G_CALLBACK (header_edit_clicked), cd); gtk_widget_set_sensitive (cd->header_edit, FALSE); - /* Populate tree view with values from gconf */ - header_list = gconf_client_get_list (client,GCONF_KEY_CUSTOM_HEADER,GCONF_VALUE_STRING, NULL); + /* Populate tree view with values from settings */ + settings = g_settings_new (ECM_SETTINGS_ID); + headers = g_settings_get_strv (settings, ECM_SETTINGS_KEY); + g_object_unref (settings); - for (list = header_list; list; list = g_slist_next (list)) { - gchar **parse_header_list; + if (headers) { + gint ii; - buffer = list->data; - gtk_list_store_append (cd->store, &iter); + for (ii = 0; headers[ii]; ii++) { + gchar **parse_header_list; - parse_header_list = g_strsplit_set (buffer, "=,", -1); + gtk_list_store_append (cd->store, &iter); - gtk_list_store_set (cd->store, &iter, HEADER_KEY_COLUMN, parse_header_list[0], -1); + parse_header_list = g_strsplit_set (headers[ii], "=,", -1); - for (index = 0; parse_header_list[index + 1] ; ++index) { - gtk_list_store_set (cd->store, &iter, HEADER_VALUE_COLUMN, parse_header_list[index + 1], -1); + gtk_list_store_set (cd->store, &iter, HEADER_KEY_COLUMN, parse_header_list[0], -1); + + for (index = 0; parse_header_list[index + 1] ; ++index) { + gtk_list_store_set (cd->store, &iter, HEADER_VALUE_COLUMN, parse_header_list[index + 1], -1); + } } - } - if (header_list) { - g_slist_foreach (header_list, (GFunc) g_free, NULL); - g_slist_free (header_list); + g_strfreev (headers); } /* Add the list here */ diff --git a/plugins/email-custom-header/email-custom-header.h b/plugins/email-custom-header/email-custom-header.h index 1a1c35c5a1..49c4b7432d 100644 --- a/plugins/email-custom-header/email-custom-header.h +++ b/plugins/email-custom-header/email-custom-header.h @@ -86,7 +86,5 @@ static guint signals[LAST_SIGNAL] = {0}; CustomHeaderOptionsDialog *epech_dialog_new (void); static gboolean epech_dialog_run (CustomHeaderOptionsDialog *mch, GtkWidget *parent); -static void epech_get_header_list (CustomHeaderOptionsDialog *mch); -static void epech_load_from_gconf (GConfClient *client,const gchar *path,CustomHeaderOptionsDialog *mch); +static void epech_load_from_settings (GSettings *settings, const gchar *path, CustomHeaderOptionsDialog *mch); #endif - diff --git a/plugins/external-editor/Makefile.am b/plugins/external-editor/Makefile.am index 070599347a..f0ffd1ac67 100644 --- a/plugins/external-editor/Makefile.am +++ b/plugins/external-editor/Makefile.am @@ -48,46 +48,13 @@ liborg_gnome_external_editor_la_LIBADD = \ $(GNOME_PLATFORM_LIBS) \ $(GTKHTML_LIBS) -schemadir = $(GCONF_SCHEMA_FILE_DIR) -schema_in_files = apps-evolution-external-editor.schemas.in -schema_DATA = $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - -if GCONF_SCHEMAS_INSTALL - -if OS_WIN32 -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - (echo set GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE); \ - echo $(GCONFTOOL) --makefile-install-rule $$p) >_temp.bat; \ - cmd /c _temp.bat; \ - rm _temp.bat; \ - done \ - fi -else -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ - $(GCONFTOOL) --makefile-install-rule $$p; \ - done \ - fi -endif - -endif - EXTRA_DIST = \ org-gnome-external-editor.eplug.xml \ - org-gnome-external-editor.error.xml \ - $(schema_in_files) + org-gnome-external-editor.error.xml BUILT_SOURCES = org-gnome-external-editor.eplug \ org-gnome-external-editor.error CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = $(schema_DATA) - -include $(top_srcdir)/git.mk diff --git a/plugins/external-editor/apps-evolution-external-editor.schemas.in b/plugins/external-editor/apps-evolution-external-editor.schemas.in deleted file mode 100644 index 0f7db301e8..0000000000 --- a/plugins/external-editor/apps-evolution-external-editor.schemas.in +++ /dev/null @@ -1,28 +0,0 @@ -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/evolution/eplugin/external-editor/editor-command</key> - <applyto>/apps/evolution/eplugin/external-editor/editor-command</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default>gedit</default> - <locale name="C"> - <short>Default External Editor</short> - <long>The default command that must be used as the editor.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/eplugin/external-editor/launch-on-key-press</key> - <applyto>/apps/evolution/eplugin/external-editor/launch-on-key-press</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Automatically launch when a new mail is edited</short> - <long>Automatically launch editor when key is pressed in the mail composer</long> - </locale> - </schema> - </schemalist> -</gconfschemafile> - diff --git a/plugins/face/Makefile.am b/plugins/face/Makefile.am index f266a410b7..0522cc0f82 100644 --- a/plugins/face/Makefile.am +++ b/plugins/face/Makefile.am @@ -34,18 +34,9 @@ error_DATA = org-gnome-face.error errordir = $(privdatadir)/errors -# GConf schemas - -schemadir = $(GCONF_SCHEMA_FILE_DIR) -schema_in_files = apps_evolution_eplugin_face.schemas.in -schema_DATA = $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - EXTRA_DIST = \ org-gnome-face.eplug.xml \ - org-gnome-face.error.xml \ - $(schema_in_files) + org-gnome-face.error.xml BUILT_SOURCES = \ org-gnome-face.eplug \ @@ -53,30 +44,4 @@ BUILT_SOURCES = \ CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = $(schema_DATA) - -if GCONF_SCHEMAS_INSTALL - -if OS_WIN32 -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - (echo set GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE); \ - echo $(GCONFTOOL) --makefile-install-rule $$p) >_temp.bat; \ - cmd /c _temp.bat; \ - rm _temp.bat; \ - done \ - fi -else -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ - $(GCONFTOOL) --makefile-install-rule $$p; \ - done \ - fi -endif - -endif - -include $(top_srcdir)/git.mk diff --git a/plugins/face/apps_evolution_eplugin_face.schemas.in b/plugins/face/apps_evolution_eplugin_face.schemas.in deleted file mode 100644 index 7583172f22..0000000000 --- a/plugins/face/apps_evolution_eplugin_face.schemas.in +++ /dev/null @@ -1,17 +0,0 @@ -<gconfschemafile> - <schemalist> - - <schema> - <key>/schemas/apps/evolution/eplugin/face/insert_by_default</key> - <applyto>/apps/evolution/eplugin/face/insert_by_default</applyto> - <owner>org.gnome.evolution.plugins.face</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Insert Face picture by default</short> - <long>Whether insert Face picture to outgoing messages by default. The picture should be set before checking this, otherwise nothing happens.</long> - </locale> - </schema> - - </schemalist> -</gconfschemafile> diff --git a/plugins/mail-notification/Makefile.am b/plugins/mail-notification/Makefile.am index 65b3acbdc3..042dcd0c9e 100644 --- a/plugins/mail-notification/Makefile.am +++ b/plugins/mail-notification/Makefile.am @@ -37,44 +37,11 @@ liborg_gnome_mail_notification_la_LIBADD = \ $(CANBERRA_LIBS) \ $(GTKHTML_LIBS) -schemadir = $(GCONF_SCHEMA_FILE_DIR) -schema_in_files = apps-evolution-mail-notification.schemas.in -schema_DATA = $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - -if GCONF_SCHEMAS_INSTALL - -if OS_WIN32 -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - (echo set GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE); \ - echo $(GCONFTOOL) --makefile-install-rule $$p) >_temp.bat; \ - cmd /c _temp.bat; \ - rm _temp.bat; \ - done \ - fi -else -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ - $(GCONFTOOL) --makefile-install-rule $$p; \ - done \ - fi -endif - -endif - BUILT_SOURCES = $(plugin_DATA) CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = $(schema_DATA) - EXTRA_DIST = \ - org-gnome-mail-notification.eplug.xml \ - $(schema_in_files) + org-gnome-mail-notification.eplug.xml -include $(top_srcdir)/git.mk diff --git a/plugins/mail-notification/apps-evolution-mail-notification.schemas.in b/plugins/mail-notification/apps-evolution-mail-notification.schemas.in deleted file mode 100644 index 03d742b718..0000000000 --- a/plugins/mail-notification/apps-evolution-mail-notification.schemas.in +++ /dev/null @@ -1,73 +0,0 @@ -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/evolution/eplugin/mail-notification/notify-only-inbox</key> - <applyto>/apps/evolution/eplugin/mail-notification/notify-only-inbox</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Notify new messages for Inbox only.</short> - <long>Whether to notify new messages in Inbox folder only.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/eplugin/mail-notification/status-enabled</key> - <applyto>/apps/evolution/eplugin/mail-notification/status-enabled</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Enable icon in notification area.</short> - <long>Show new mail icon in notification area when new messages arrive.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/eplugin/mail-notification/sound-enabled</key> - <applyto>/apps/evolution/eplugin/mail-notification/sound-enabled</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Play sound when new messages arrive.</short> - <long>Whether play sound or beep when new messages arrive.</long> - </locale> - </schema> - <schema> - <key>/schemas/apps/evolution/eplugin/mail-notification/sound-beep</key> - <applyto>/apps/evolution/eplugin/mail-notification/sound-beep</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Beep or play sound file.</short> - <long>If "true", then beep, otherwise will play sound file when new messages arrive.</long> - </locale> - </schema> - <schema> - <key>/schemas/apps/evolution/eplugin/mail-notification/sound-file</key> - <applyto>/apps/evolution/eplugin/mail-notification/sound-file</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default></default> - <locale name="C"> - <short>Sound filename to be played.</short> - <long>Sound file to be played when new messages arrive, if not in beep mode.</long> - </locale> - </schema> - <schema> - <key>/schemas/apps/evolution/eplugin/mail-notification/sound-use-theme</key> - <applyto>/apps/evolution/eplugin/mail-notification/sound-use-theme</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Use sound theme</short> - <long>Play themed sound when new messages arrive, if not in beep mode.</long> - </locale> - </schema> - </schemalist> -</gconfschemafile> - diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index af4eb28cf7..ff9814f795 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -26,7 +26,6 @@ #include <string.h> #include <gtk/gtk.h> -#include <gconf/gconf-client.h> #include <glib/gi18n.h> #include <gio/gio.h> @@ -470,12 +469,12 @@ publish (EPublishUri *uri, } typedef struct { - GConfClient *gconf; - GtkWidget *treeview; - GtkWidget *url_add; - GtkWidget *url_edit; - GtkWidget *url_remove; - GtkWidget *url_enable; + GSettings *settings; + GtkWidget *treeview; + GtkWidget *url_add; + GtkWidget *url_edit; + GtkWidget *url_remove; + GtkWidget *url_enable; } PublishUIData; static void @@ -499,9 +498,12 @@ add_timeout (EPublishUri *uri) static void update_timestamp (EPublishUri *uri) { - GConfClient *client; - GSList *uris, *l; + GSettings *settings; + gchar **set_uris; + GPtrArray *uris_array; + gboolean found = FALSE; gchar *xml; + gint ii; guint id; /* Remove timeout if we have one */ @@ -511,32 +513,40 @@ update_timestamp (EPublishUri *uri) add_timeout (uri); } - /* Update timestamp in gconf */ + /* Update timestamp in settings */ xml = e_publish_uri_to_xml (uri); - client = gconf_client_get_default (); - uris = gconf_client_get_list (client, "/apps/evolution/calendar/publish/uris", GCONF_VALUE_STRING, NULL); - for (l = uris; l; l = g_slist_next (l)) { - gchar *d = l->data; - if (strcmp (d, xml) == 0) { - uris = g_slist_remove (uris, d); - g_free (d); - break; - } - } - g_free (xml); - if (uri->last_pub_time) g_free (uri->last_pub_time); uri->last_pub_time = g_strdup_printf ("%d", (gint) time (NULL)); - uris = g_slist_prepend (uris, e_publish_uri_to_xml (uri)); + uris_array = g_ptr_array_new_full (3, g_free); + settings = g_settings_new (PC_SETTINGS_ID); + set_uris = g_settings_get_strv (settings, PC_SETTINGS_URIS); + + for (ii = 0; set_uris && set_uris[ii]; ii++) { + const gchar *d = set_uris[ii]; + + if (!found && g_str_equal (d, xml)) { + found = TRUE; + g_ptr_array_add (uris_array, e_publish_uri_to_xml (uri)); + } else { + g_ptr_array_add (uris_array, g_strdup (d)); + } + } + + g_strfreev (set_uris); + g_free (xml); - gconf_client_set_list (client, "/apps/evolution/calendar/publish/uris", GCONF_VALUE_STRING, uris, NULL); + /* this should not happen, right? */ + if (!found) + g_ptr_array_add (uris_array, e_publish_uri_to_xml (uri)); + g_ptr_array_add (uris_array, NULL); - g_slist_foreach (uris, (GFunc) g_free, NULL); - g_slist_free (uris); - g_object_unref (client); + g_settings_set_strv (settings, PC_SETTINGS_URIS, (const gchar * const *) uris_array->pdata); + + g_object_unref (settings); + g_ptr_array_free (uris_array, TRUE); } static void @@ -575,12 +585,12 @@ static void url_list_changed (PublishUIData *ui) { GtkTreeModel *model = NULL; - GSList *url_list = NULL; + GPtrArray *uris; GtkTreeIter iter; gboolean valid; - GConfClient *client; + GSettings *settings; - url_list = NULL; + uris = g_ptr_array_new_full (3, g_free); model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview)); valid = gtk_tree_model_get_iter_first (model, &iter); @@ -590,15 +600,19 @@ url_list_changed (PublishUIData *ui) gtk_tree_model_get (model, &iter, URL_LIST_URL_COLUMN, &url, -1); - if ((xml = e_publish_uri_to_xml (url))) - url_list = g_slist_append (url_list, xml); + if ((xml = e_publish_uri_to_xml (url)) != NULL) + g_ptr_array_add (uris, xml); valid = gtk_tree_model_iter_next (model, &iter); } - client = gconf_client_get_default (); - gconf_client_set_list (client, "/apps/evolution/calendar/publish/uris", GCONF_VALUE_STRING, url_list, NULL); - g_slist_foreach (url_list, (GFunc) g_free, NULL); - g_slist_free (url_list); + + g_ptr_array_add (uris, NULL); + + settings = g_settings_new (PC_SETTINGS_ID); + g_settings_set_strv (settings, PC_SETTINGS_URIS, (const gchar * const *) uris->pdata); + g_object_unref (settings); + + g_ptr_array_free (uris, TRUE); } static void @@ -926,21 +940,18 @@ publish_urls (gpointer data) } static gpointer -publish_uris_set_timeout (GSList *uris) +publish_uris_set_timeout (gchar **uris) { - GSList *l; + gint ii; uri_timeouts = g_hash_table_new (g_direct_hash, g_direct_equal); - l = uris; - - while (l) { - gchar *xml = l->data; + for (ii = 0; uris && uris[ii]; ii++) { + const gchar *xml = uris[ii]; EPublishUri *uri = e_publish_uri_from_xml (xml); if (!uri->location) { g_free (uri); - l = g_slist_next (l); continue; } @@ -948,11 +959,9 @@ publish_uris_set_timeout (GSList *uris) /* Add a timeout based on the last publish time */ add_offset_timeout (uri); - - l = g_slist_next (l); } - g_slist_foreach (uris, (GFunc) g_free, NULL); - g_slist_free (uris); + + g_strfreev (uris); return NULL; } @@ -961,8 +970,6 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable) { - GSList *uris; - GConfClient *client; EShell *shell = e_shell_get_default (); if (shell) { @@ -976,17 +983,20 @@ e_plugin_lib_enable (EPlugin *ep, } if (enable) { + GSettings *settings; + gchar **uris; GThread *thread = NULL; GError *error = NULL; - client = gconf_client_get_default (); - uris = gconf_client_get_list (client, "/apps/evolution/calendar/publish/uris", GCONF_VALUE_STRING, NULL); + settings = g_settings_new (PC_SETTINGS_ID); + uris = g_settings_get_strv (settings, PC_SETTINGS_URIS); + g_object_unref (settings); + thread = g_thread_create ((GThreadFunc) publish_uris_set_timeout, uris, FALSE, &error); if (!thread) { g_warning ("Could create thread to set timeout for publishing uris : %s", error->message); g_error_free (error); } - g_object_unref (client); } return 0; diff --git a/plugins/publish-calendar/publish-location.c b/plugins/publish-calendar/publish-location.c index 12fd8a3b5b..c0d46c1cd9 100644 --- a/plugins/publish-calendar/publish-location.c +++ b/plugins/publish-calendar/publish-location.c @@ -29,34 +29,23 @@ #include <string.h> #include <libxml/tree.h> -#include <gconf/gconf-client.h> #include <libedataserverui/libedataserverui.h> static EPublishUri * migrateURI (const gchar *xml, xmlDocPtr doc) { - GConfClient *client; - GSList *uris, *l, *events = NULL; + GSettings *settings; + GSList *events = NULL; + gchar **set_uris; + GPtrArray *uris_array; xmlChar *location, *enabled, *frequency, *username; xmlNodePtr root, p; EPublishUri *uri; gchar *password, *temp; EUri *euri; - - client = gconf_client_get_default (); - uris = gconf_client_get_list ( - client, "/apps/evolution/calendar/publish/uris", - GCONF_VALUE_STRING, NULL); - l = uris; - while (l && l->data) { - gchar *str = l->data; - if (strcmp (xml, str) == 0) { - uris = g_slist_remove (uris, str); - g_free (str); - } - l = g_slist_next (l); - } + gint ii; + gboolean found = FALSE; uri = g_new0 (EPublishUri, 1); @@ -106,13 +95,32 @@ migrateURI (const gchar *xml, } uri->events = events; - uris = g_slist_prepend (uris, e_publish_uri_to_xml (uri)); - gconf_client_set_list ( - client, "/apps/evolution/calendar/publish/uris", - GCONF_VALUE_STRING, uris, NULL); - g_slist_foreach (uris, (GFunc) g_free, NULL); - g_slist_free (uris); - g_object_unref (client); + uris_array = g_ptr_array_new_full (3, g_free); + + settings = g_settings_new (PC_SETTINGS_ID); + set_uris = g_settings_get_strv (settings, PC_SETTINGS_URIS); + + for (ii = 0; set_uris && set_uris[ii]; ii++) { + const gchar *str = set_uris[ii]; + if (!found && g_str_equal (xml, str)) { + found = TRUE; + g_ptr_array_add (uris_array, e_publish_uri_to_xml (uri)); + } else { + g_ptr_array_add (uris_array, g_strdup (str)); + } + } + + g_strfreev (set_uris); + + /* this should not happen, right? */ + if (!found) + g_ptr_array_add (uris_array, e_publish_uri_to_xml (uri)); + g_ptr_array_add (uris_array, NULL); + + g_settings_set_strv (settings, PC_SETTINGS_URIS, (const gchar * const *) uris_array->pdata); + + g_ptr_array_free (uris_array, TRUE); + g_object_unref (settings); cleanup: xmlFree (location); diff --git a/plugins/publish-calendar/publish-location.h b/plugins/publish-calendar/publish-location.h index a55d432a8e..e70af36b2e 100644 --- a/plugins/publish-calendar/publish-location.h +++ b/plugins/publish-calendar/publish-location.h @@ -26,6 +26,9 @@ #include <glib.h> +#define PC_SETTINGS_ID "org.gnome.evolution.plugin.publish-calendar" +#define PC_SETTINGS_URIS "uris" + G_BEGIN_DECLS enum publish_frequency { diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c index b042ee0fe9..0c7d97c140 100644 --- a/plugins/save-calendar/rdf-format.c +++ b/plugins/save-calendar/rdf-format.c @@ -26,7 +26,6 @@ #include <string.h> #include <glib/gi18n.h> -#include <gconf/gconf-client.h> #include <libxml/xmlmemory.h> #include <libxml/parser.h> diff --git a/plugins/templates/Makefile.am b/plugins/templates/Makefile.am index c899a44368..d4a637d0c3 100644 --- a/plugins/templates/Makefile.am +++ b/plugins/templates/Makefile.am @@ -29,43 +29,10 @@ liborg_gnome_templates_la_LIBADD = \ $(GNOME_PLATFORM_LIBS) \ $(GTKHTML_LIBS) -schemadir = $(GCONF_SCHEMA_FILE_DIR) -schema_in_files = apps-evolution-template-placeholders.schemas.in -schema_DATA = $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - -if GCONF_SCHEMAS_INSTALL - -if OS_WIN32 -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - (echo set GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE); \ - echo $(GCONFTOOL) --makefile-install-rule $$p) >_temp.bat; \ - cmd /c _temp.bat; \ - rm _temp.bat; \ - done \ - fi -else -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ - $(GCONFTOOL) --makefile-install-rule $$p; \ - done \ - fi -endif - -endif - -EXTRA_DIST = org-gnome-templates.eplug.xml \ - $(schema_in_files) +EXTRA_DIST = org-gnome-templates.eplug.xml BUILT_SOURCES = org-gnome-templates.eplug CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = $(schema_DATA) - -include $(top_srcdir)/git.mk diff --git a/plugins/templates/apps-evolution-template-placeholders.schemas.in b/plugins/templates/apps-evolution-template-placeholders.schemas.in deleted file mode 100644 index c6a1f4d07d..0000000000 --- a/plugins/templates/apps-evolution-template-placeholders.schemas.in +++ /dev/null @@ -1,26 +0,0 @@ -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/evolution/mail/template_placeholders</key> - <applyto>/apps/evolution/mail/template_placeholders</applyto> - <owner>evolution-mail</owner> - <type>list</type> - <list_type>string</list_type> - - <!-- The following are the keyword/value pairs used by the plugin to - substitute the messages stored under the Templates folder. The list can - have any number of such pairs.--> - - <default>[myphone=012345,myplace=Abcd,myname=Alice]</default> - <locale name="C"> - <short>List of keyword/value pairs for the Templates plugin to - substitute in a message body.</short> - <long> - List of keyword/value pairs for the Templates plugin to - substitute in a message body. - </long> - </locale> - </schema> - </schemalist> -</gconfschemafile> - |