]> git.0d.be Git - empathy.git/commitdiff
move get blank iter function
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 30 Jan 2009 17:33:59 +0000 (17:33 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 30 Jan 2009 17:33:59 +0000 (17:33 +0000)
svn path=/trunk/; revision=2321

libempathy-gtk/empathy-contact-selector.c

index 09ebb2d64378e9b0f66031e48b6859a48c99bc2d..8d93b6f4c682c6be61d7c8754a4f1c34e6af263d 100644 (file)
@@ -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,