diff options
author | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2009-01-31 01:33:59 +0800 |
---|---|---|
committer | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2009-01-31 01:33:59 +0800 |
commit | 0fe41cbeaee6ad112a665a865a6dfbad3e6b90b8 (patch) | |
tree | 8a83c608dc4928fb5de077ae06e79bd84a8cf4e9 | |
parent | ca950311282b5def329d92ba66987439e4da5c30 (diff) | |
download | gsoc2013-empathy-0fe41cbeaee6ad112a665a865a6dfbad3e6b90b8.tar gsoc2013-empathy-0fe41cbeaee6ad112a665a865a6dfbad3e6b90b8.tar.gz gsoc2013-empathy-0fe41cbeaee6ad112a665a865a6dfbad3e6b90b8.tar.bz2 gsoc2013-empathy-0fe41cbeaee6ad112a665a865a6dfbad3e6b90b8.tar.lz gsoc2013-empathy-0fe41cbeaee6ad112a665a865a6dfbad3e6b90b8.tar.xz gsoc2013-empathy-0fe41cbeaee6ad112a665a865a6dfbad3e6b90b8.tar.zst gsoc2013-empathy-0fe41cbeaee6ad112a665a865a6dfbad3e6b90b8.zip |
move get blank iter function
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@2321 4ee84921-47dd-4033-b63a-18d7a039a3e4
-rw-r--r-- | libempathy-gtk/empathy-contact-selector.c | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c index 09ebb2d64..8d93b6f4c 100644 --- a/libempathy-gtk/empathy-contact-selector.c +++ b/libempathy-gtk/empathy-contact-selector.c @@ -50,8 +50,6 @@ struct _EmpathyContactSelectorPriv }; static void changed_cb (GtkComboBox *widget, gpointer data); -static gboolean get_iter_for_blank_contact (GtkTreeStore *store, - GtkTreeIter *blank_iter); EmpathyContact * @@ -71,6 +69,38 @@ empathy_contact_selector_get_selected (EmpathyContactSelector *selector) } +static gboolean +get_iter_for_blank_contact (GtkTreeStore *store, + GtkTreeIter *blank_iter) +{ + GtkTreePath *path; + GtkTreeIter tmp_iter; + EmpathyContact *tmp_contact; + gboolean is_present = FALSE; + + path = gtk_tree_path_new_first (); + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &tmp_iter, path)) + { + do + { + gtk_tree_model_get (GTK_TREE_MODEL (store), + &tmp_iter, EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, + &tmp_contact, -1); + if (tmp_contact == NULL) + { + *blank_iter = tmp_iter; + is_present = TRUE; + break; + } + } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &tmp_iter)); + } + + gtk_tree_path_free (path); + + return is_present; +} + + static void set_blank_contact (EmpathyContactSelector *selector) { @@ -157,38 +187,6 @@ changed_cb (GtkComboBox *widget, } -static gboolean -get_iter_for_blank_contact (GtkTreeStore *store, - GtkTreeIter *blank_iter) -{ - GtkTreePath *path; - GtkTreeIter tmp_iter; - EmpathyContact *tmp_contact; - gboolean is_present = FALSE; - - path = gtk_tree_path_new_first (); - if (gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &tmp_iter, path)) - { - do - { - gtk_tree_model_get (GTK_TREE_MODEL (store), - &tmp_iter, EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, - &tmp_contact, -1); - if (tmp_contact == NULL) - { - *blank_iter = tmp_iter; - is_present = TRUE; - break; - } - } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &tmp_iter)); - } - - gtk_tree_path_free (path); - - return is_present; -} - - static void empathy_store_row_changed_cb (EmpathyContactListStore *empathy_store, GtkTreePath *empathy_path, |