GNOME Bugzilla – Bug 648914
Favourite contacts appear in other contact list groups when offline
Last modified: 2011-05-02 08:52:01 UTC
When View > Offline Contacts is not selected, favourite contacts still appear in groups in the contact list when they are offline. It may well be useful for them to be displayed in the Favourites group even when offline, but they should not appear in user-defined groups unless View > Offline Contacts is selected.
I think you're right, they are displayed by design but should only be in the Favorite group.
Created attachment 186885 [details] [review] Display favorite offline contacts only in the Favorite group (#648914)
Comment on attachment 186885 [details] [review] Display favorite offline contacts only in the Favorite group (#648914) >+ GtkTreePath *path = gtk_tree_model_get_path (model, iter); >+ GtkTreePath *parent_path; >+ GtkTreeIter parent_iter; >+ gchar *name; >+ >+ *is_fake = FALSE; >+ >+ parent_path = gtk_tree_path_copy (path); >+ if (!gtk_tree_path_up (parent_path)) >+ return NULL; >+ >+ if (!gtk_tree_model_get_iter (model, &parent_iter, parent_path)) >+ return NULL; >+ >+ gtk_tree_model_get (model, &parent_iter, >+ EMPATHY_INDIVIDUAL_STORE_COL_NAME, &name, >+ EMPATHY_INDIVIDUAL_STORE_COL_IS_FAKE_GROUP, is_fake, >+ -1); >+ >+ return name; >+} You're leaking parent_path. Looks good otherwise.
Created attachment 186891 [details] [review] Display favorite offline contacts only in the Favorite group (#648914)
Nice catch! When I wrote this code I said myself "Don't forget to add the free after testing" and guess what... I forgot. :) Anyway, fixed.
Looks good. I have just remembered that you can do if (gtk_tree_model_iter_parent (model, &parent_iter, iter)) return NULL; instead of getting, copying and freeing the path. Should make the code cleaner
Created attachment 187011 [details] [review] Display favorite offline contacts only in the Favorite group (#648914)
Comment on attachment 187011 [details] [review] Display favorite offline contacts only in the Favorite group (#648914) Looks good
Merged to master and 3.0. commit 85058e4e3f88412683771172f7dace66366ad069 Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> Date: Fri Apr 29 15:47:50 2011 +0200 Display favorite offline contacts only in the Favorite group (#648914) This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.