diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-08-31 16:07:57 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-08-31 19:32:03 +0800 |
commit | 1ff28ec682cd537f7626e1fac53457139301b64f (patch) | |
tree | a529105c6433a41880367b0efe4abc1cd0142333 /libempathy-gtk | |
parent | 2957c34ec79bc2585435d99e43f6bfb048025285 (diff) | |
download | gsoc2013-empathy-1ff28ec682cd537f7626e1fac53457139301b64f.tar.gz gsoc2013-empathy-1ff28ec682cd537f7626e1fac53457139301b64f.tar.zst gsoc2013-empathy-1ff28ec682cd537f7626e1fac53457139301b64f.zip |
roster-view: factor out check_if_empty()
https://bugzilla.gnome.org/show_bug.cgi?id=682926
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index 00544fbb0..30e6c98d2 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -247,6 +247,24 @@ ensure_roster_group (EmpathyRosterView *self, } static void +update_empty (EmpathyRosterView *self, + gboolean empty) +{ + if (self->priv->empty == empty) + return; + + self->priv->empty = empty; + g_object_notify (G_OBJECT (self), "empty"); +} + +static void +check_if_empty (EmpathyRosterView *self) +{ + if (g_hash_table_size (self->priv->displayed_contacts) == 0) + update_empty (self, TRUE); +} + +static void update_group_widgets (EmpathyRosterView *self, EmpathyRosterGroup *group, EmpathyRosterContact *contact, @@ -694,17 +712,6 @@ is_searching (EmpathyRosterView *self) } static void -update_empty (EmpathyRosterView *self, - gboolean empty) -{ - if (self->priv->empty == empty) - return; - - self->priv->empty = empty; - g_object_notify (G_OBJECT (self), "empty"); -} - -static void add_to_displayed (EmpathyRosterView *self, EmpathyRosterContact *contact) { @@ -750,8 +757,7 @@ remove_from_displayed (EmpathyRosterView *self, { g_hash_table_remove (self->priv->displayed_contacts, contact); - if (g_hash_table_size (self->priv->displayed_contacts) == 0) - update_empty (self, TRUE); + check_if_empty (self); } /** |