diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-06-10 12:16:00 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-06-18 09:34:19 +0800 |
commit | 96569c764125b9c80909c7cece9e37b65eb632ca (patch) | |
tree | 27afa60ac7dc1c6bce5195b8b9bcf645b6fe97a6 /libempathy-gtk/empathy-notify-manager.c | |
parent | f748067f6fa10635261313a28e0a0102168de91e (diff) | |
download | gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.gz gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.bz2 gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.lz gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.xz gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.zst gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.zip |
Port Empathy code to GSettings, remove EmpathyConf
Diffstat (limited to 'libempathy-gtk/empathy-notify-manager.c')
-rw-r--r-- | libempathy-gtk/empathy-notify-manager.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-notify-manager.c b/libempathy-gtk/empathy-notify-manager.c index 8f7991166..d0e0aadec 100644 --- a/libempathy-gtk/empathy-notify-manager.c +++ b/libempathy-gtk/empathy-notify-manager.c @@ -25,10 +25,10 @@ #include <telepathy-glib/account-manager.h> +#include <libempathy/empathy-gsettings.h> #include <libempathy/empathy-utils.h> #include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-conf.h> #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include <libempathy/empathy-debug.h> @@ -184,23 +184,20 @@ gboolean empathy_notify_manager_notification_is_enabled (EmpathyNotifyManager *self) { EmpathyNotifyManagerPriv *priv = GET_PRIV (self); - EmpathyConf *conf; - gboolean res; + GSettings *gsettings = g_settings_new (EMPATHY_PREFS_NOTIFICATIONS_SCHEMA); TpConnectionPresenceType presence; + gboolean ret = FALSE; - conf = empathy_conf_get (); - res = FALSE; - - empathy_conf_get_bool (conf, EMPATHY_PREFS_NOTIFICATIONS_ENABLED, &res); - - if (!res) - return FALSE; + if (!g_settings_get_boolean (gsettings, EMPATHY_PREFS_NOTIFICATIONS_ENABLED)) + goto finally; if (!tp_account_manager_is_prepared (priv->account_manager, TP_ACCOUNT_MANAGER_FEATURE_CORE)) { DEBUG ("account manager is not ready yet; display the notification"); - return TRUE; + ret = TRUE; + + goto finally; } presence = tp_account_manager_get_most_available_presence ( @@ -210,12 +207,15 @@ empathy_notify_manager_notification_is_enabled (EmpathyNotifyManager *self) if (presence != TP_CONNECTION_PRESENCE_TYPE_AVAILABLE && presence != TP_CONNECTION_PRESENCE_TYPE_UNSET) { - empathy_conf_get_bool (conf, EMPATHY_PREFS_NOTIFICATIONS_DISABLED_AWAY, - &res); - - if (res) - return FALSE; + if (!g_settings_get_boolean (gsettings, + EMPATHY_PREFS_NOTIFICATIONS_DISABLED_AWAY)) + goto finally; } - return TRUE; + ret = TRUE; + +finally: + g_object_unref (gsettings); + + return ret; } |