diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-11-22 17:04:40 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-11-24 19:29:03 +0800 |
commit | 70ec5dfc46d6177c74139ad84e6a74f521e8b374 (patch) | |
tree | f4dcf03134f55bb8929ca1675fceef67f3cee4a7 /libempathy-gtk/empathy-individual-store.c | |
parent | f13e0c152b9de168c88f6ebde45c8e35e4df4934 (diff) | |
download | gsoc2013-empathy-70ec5dfc46d6177c74139ad84e6a74f521e8b374.tar gsoc2013-empathy-70ec5dfc46d6177c74139ad84e6a74f521e8b374.tar.gz gsoc2013-empathy-70ec5dfc46d6177c74139ad84e6a74f521e8b374.tar.bz2 gsoc2013-empathy-70ec5dfc46d6177c74139ad84e6a74f521e8b374.tar.lz gsoc2013-empathy-70ec5dfc46d6177c74139ad84e6a74f521e8b374.tar.xz gsoc2013-empathy-70ec5dfc46d6177c74139ad84e6a74f521e8b374.tar.zst gsoc2013-empathy-70ec5dfc46d6177c74139ad84e6a74f521e8b374.zip |
add initial_loading() as a virtual method
This allows us to remove setup_idle_id as a protected variable.
https://bugzilla.gnome.org/show_bug.cgi?id=663387
Diffstat (limited to 'libempathy-gtk/empathy-individual-store.c')
-rw-r--r-- | libempathy-gtk/empathy-individual-store.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c index d2ba6297a..aa3f6334d 100644 --- a/libempathy-gtk/empathy-individual-store.c +++ b/libempathy-gtk/empathy-individual-store.c @@ -946,11 +946,6 @@ individual_store_dispose (GObject *object) g_source_remove (self->priv->inhibit_active); } - if (self->setup_idle_id != 0) - { - g_source_remove (self->setup_idle_id); - } - g_hash_table_unref (self->priv->status_icons); g_hash_table_unref (self->priv->folks_individual_cache); g_hash_table_unref (self->priv->empathy_group_cache); @@ -1500,8 +1495,12 @@ void empathy_individual_store_set_show_groups (EmpathyIndividualStore *self, gboolean show_groups) { + EmpathyIndividualStoreClass *klass; + g_return_if_fail (EMPATHY_IS_INDIVIDUAL_STORE (self)); + klass = EMPATHY_INDIVIDUAL_STORE_GET_CLASS ( self); + if (self->priv->show_groups == show_groups) { return; @@ -1509,7 +1508,7 @@ empathy_individual_store_set_show_groups (EmpathyIndividualStore *self, self->priv->show_groups = show_groups; - if (self->setup_idle_id == 0) + if (!klass->initial_loading (self)) { /* Remove all contacts and add them back, not optimized but * that's the easy way :) @@ -1517,8 +1516,6 @@ empathy_individual_store_set_show_groups (EmpathyIndividualStore *self, * This is only done if there's not a pending setup idle * callback, otherwise it will race and the contacts will get * added twice */ - EmpathyIndividualStoreClass *klass = EMPATHY_INDIVIDUAL_STORE_GET_CLASS ( - self); gtk_tree_store_clear (GTK_TREE_STORE (self)); /* Also clear the cache */ |