aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-29 23:32:38 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-29 23:32:38 +0800
commit6fb9b3aaa5c4b8cb82820548ada136380088584d (patch)
tree158793e0947b099b2d7ec91a095596a68f0f8e02
parent6408432db9e2b1240c1cfea461d330ac0a01e49a (diff)
downloadgsoc2013-empathy-6fb9b3aaa5c4b8cb82820548ada136380088584d.tar
gsoc2013-empathy-6fb9b3aaa5c4b8cb82820548ada136380088584d.tar.gz
gsoc2013-empathy-6fb9b3aaa5c4b8cb82820548ada136380088584d.tar.bz2
gsoc2013-empathy-6fb9b3aaa5c4b8cb82820548ada136380088584d.tar.lz
gsoc2013-empathy-6fb9b3aaa5c4b8cb82820548ada136380088584d.tar.xz
gsoc2013-empathy-6fb9b3aaa5c4b8cb82820548ada136380088584d.tar.zst
gsoc2013-empathy-6fb9b3aaa5c4b8cb82820548ada136380088584d.zip
event-manager: cache the UI GSettings
-rw-r--r--src/empathy-event-manager.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 11f95f52b..e40d1c25f 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -84,6 +84,7 @@ typedef struct {
gint ringing;
GSettings *gsettings_notif;
+ GSettings *gsettings_ui;
} EmpathyEventManagerPriv;
typedef struct _EventPriv EventPriv;
@@ -199,19 +200,12 @@ autoremove_event_timeout_cb (EventPriv *event)
}
static gboolean
-display_notify_area (void)
-
+display_notify_area (EmpathyEventManager *self)
{
- GSettings *gsettings;
- gboolean result;
-
- gsettings = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
+ EmpathyEventManagerPriv *priv = GET_PRIV (self);
- result = g_settings_get_boolean (gsettings,
+ return g_settings_get_boolean (priv->gsettings_ui,
EMPATHY_PREFS_UI_EVENTS_NOTIFY_AREA);
- g_object_unref (gsettings);
-
- return result;
}
static void
@@ -244,7 +238,7 @@ event_manager_add (EmpathyEventManager *manager,
DEBUG ("Adding event %p", event);
priv->events = g_slist_prepend (priv->events, event);
- if (!display_notify_area ())
+ if (!display_notify_area (manager))
{
/* Don't fire the 'event-added' signal as we activate the event now */
if (approval != NULL)
@@ -1146,6 +1140,7 @@ event_manager_finalize (GObject *object)
g_object_unref (priv->contact_manager);
g_object_unref (priv->approver);
g_object_unref (priv->gsettings_notif);
+ g_object_unref (priv->gsettings_ui);
}
static void
@@ -1199,6 +1194,7 @@ empathy_event_manager_init (EmpathyEventManager *manager)
manager->priv = priv;
priv->gsettings_notif = g_settings_new (EMPATHY_PREFS_NOTIFICATIONS_SCHEMA);
+ priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
priv->contact_manager = empathy_contact_manager_dup_singleton ();
g_signal_connect (priv->contact_manager, "pendings-changed",