From 698c1a83b5f2d566cf8a6500f49158f98c1efacf Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Thu, 24 Jan 2013 21:05:32 +0100 Subject: checkupdate: Migrate to GSettings --- plugins/checkupdate/pluma-check-update-plugin.c | 39 ++++++++++--------------- 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'plugins/checkupdate/pluma-check-update-plugin.c') diff --git a/plugins/checkupdate/pluma-check-update-plugin.c b/plugins/checkupdate/pluma-check-update-plugin.c index 44e4ac95..2f8bd1af 100644 --- a/plugins/checkupdate/pluma-check-update-plugin.c +++ b/plugins/checkupdate/pluma-check-update-plugin.c @@ -29,24 +29,24 @@ #include #include -#include +#include #if !GTK_CHECK_VERSION(2, 17, 1) #include #endif -#define MATECONF_KEY_BASE "/apps/pluma/plugins/checkupdate" -#define MATECONF_KEY_IGNORE_VERSION MATECONF_KEY_BASE "/ignore_version" +#define SETTINGS_SCHEMA "org.mate.pluma.plugins.checkupdate" +#define SETTINGS_IGNORE_VERSION "ignore-version" #define WINDOW_DATA_KEY "PlumaCheckUpdatePluginWindowData" #define VERSION_PLACE "" #ifdef G_OS_WIN32 -#define PLUMA_URL "http://ftp.acc.umu.se/pub/mate/binaries/win32/pluma/" +#define PLUMA_URL "http://pub.mate-desktop.org/sources/mate-text-editor/" #define FILE_REGEX "pluma\\-setup\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.exe" #else -#define PLUMA_URL "http://ftp.acc.umu.se/pub/mate/binaries/mac/pluma/" +#define PLUMA_URL "http://pub.mate-desktop.org/sources/mate-text-editor/" #define FILE_REGEX "pluma\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.dmg" #endif @@ -65,7 +65,7 @@ struct _PlumaCheckUpdatePluginPrivate { SoupSession *session; - MateConfClient *mateconf_client; + GSettings *settings; }; typedef struct @@ -101,12 +101,7 @@ pluma_check_update_plugin_init (PlumaCheckUpdatePlugin *plugin) plugin->priv->session = soup_session_async_new (); - plugin->priv->mateconf_client = mateconf_client_get_default (); - - mateconf_client_add_dir (plugin->priv->mateconf_client, - MATECONF_KEY_BASE, - MATECONF_CLIENT_PRELOAD_ONELEVEL, - NULL); + plugin->priv->settings = g_settings_new (SETTINGS_SCHEMA); } static void @@ -120,13 +115,11 @@ pluma_check_update_plugin_dispose (GObject *object) plugin->priv->session = NULL; } - if (plugin->priv->mateconf_client != NULL) + if (plugin->priv->settings != NULL) { - mateconf_client_suggest_sync (plugin->priv->mateconf_client, NULL); - - g_object_unref (G_OBJECT (plugin->priv->mateconf_client)); + g_object_unref (G_OBJECT (plugin->priv->settings)); - plugin->priv->mateconf_client = NULL; + plugin->priv->settings = NULL; } pluma_debug_message (DEBUG_PLUGINS, @@ -266,10 +259,9 @@ on_response_cb (GtkWidget *infobar, data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); - mateconf_client_set_string (data->plugin->priv->mateconf_client, - MATECONF_KEY_IGNORE_VERSION, - data->version, - NULL); + g_settings_set_string (data->plugin->priv->settings, + SETTINGS_IGNORE_VERSION, + data->version); } g_object_set_data (G_OBJECT (window), @@ -467,9 +459,8 @@ parse_file_version (const gchar *file) static gchar * get_ignore_version (PlumaCheckUpdatePlugin *plugin) { - return mateconf_client_get_string (plugin->priv->mateconf_client, - MATECONF_KEY_IGNORE_VERSION, - NULL); + return g_settings_get_string (plugin->priv->settings, + SETTINGS_IGNORE_VERSION); } static void -- cgit v1.2.1