aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:33:59 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:33:59 +0800
commit96700e661de46701033c4fc2654f7ca2683d3657 (patch)
tree8a83c608dc4928fb5de077ae06e79bd84a8cf4e9
parentb1292cf8d09a6c028f13364bd91d80249ef3d122 (diff)
downloadgsoc2013-empathy-96700e661de46701033c4fc2654f7ca2683d3657.tar
gsoc2013-empathy-96700e661de46701033c4fc2654f7ca2683d3657.tar.gz
gsoc2013-empathy-96700e661de46701033c4fc2654f7ca2683d3657.tar.bz2
gsoc2013-empathy-96700e661de46701033c4fc2654f7ca2683d3657.tar.lz
gsoc2013-empathy-96700e661de46701033c4fc2654f7ca2683d3657.tar.xz
gsoc2013-empathy-96700e661de46701033c4fc2654f7ca2683d3657.tar.zst
gsoc2013-empathy-96700e661de46701033c4fc2654f7ca2683d3657.zip
move get blank iter function
svn path=/trunk/; revision=2321
-rw-r--r--libempathy-gtk/empathy-contact-selector.c66
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,