]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-groups-widget.c
Merge branch 'gnome-3-8'
[empathy.git] / libempathy-gtk / empathy-groups-widget.c
index efb58fa99dc55d84c4b1bf8461e83d70a947be2f..b7f4b256ab5237075e890f2677c23429caf96981 100644 (file)
  *          Philip Withnall <philip.withnall@collabora.co.uk>
  */
 
-#include <config.h>
-
-#include <string.h>
-#include <stdlib.h>
+#include "config.h"
+#include "empathy-groups-widget.h"
 
-#include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
-#include <telepathy-glib/util.h>
-
-#include <folks/folks.h>
-
-#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-connection-aggregator.h>
-
-#include "empathy-groups-widget.h"
-#include "empathy-ui-utils.h"
+#include "empathy-utils.h"
+#include "empathy-connection-aggregator.h"
 
 /**
  * SECTION:empathy-groups-widget
@@ -127,7 +118,7 @@ model_find_name (EmpathyGroupsWidget *self,
   EmpathyGroupsWidgetPriv *priv = GET_PRIV (self);
   FindNameData data;
 
-  if (EMP_STR_EMPTY (name))
+  if (TPAW_STR_EMPTY (name))
     return FALSE;
 
   data.widget = self;
@@ -151,7 +142,6 @@ populate_data (EmpathyGroupsWidget *self)
 {
   EmpathyGroupsWidgetPriv *priv = GET_PRIV (self);
   EmpathyConnectionAggregator *aggregator;
-  GtkTreeIter iter;
   GeeSet *member_groups;
   GList *all_groups, *l;
 
@@ -176,14 +166,11 @@ populate_data (EmpathyGroupsWidget *self)
       enabled = gee_collection_contains (GEE_COLLECTION (member_groups),
           group_str);
 
-      gtk_list_store_append (priv->group_store, &iter);
-      gtk_list_store_set (priv->group_store, &iter,
+      gtk_list_store_insert_with_values (priv->group_store, NULL, -1,
           COL_NAME, group_str,
           COL_EDITABLE, TRUE,
           COL_ENABLED, enabled,
           -1);
-
-      g_free (l->data);
     }
 
   g_list_free (all_groups);
@@ -206,7 +193,7 @@ add_group_entry_changed_cb (GtkEditable *editable,
   else
     {
       gtk_widget_set_sensitive (GTK_WIDGET (priv->add_group_button),
-          !EMP_STR_EMPTY (group));
+          !TPAW_STR_EMPTY (group));
     }
 }
 
@@ -238,13 +225,11 @@ add_group_button_clicked_cb (GtkButton *button,
    EmpathyGroupsWidget *self)
 {
   EmpathyGroupsWidgetPriv *priv = GET_PRIV (self);
-  GtkTreeIter iter;
   const gchar *group;
 
   group = gtk_entry_get_text (GTK_ENTRY (priv->add_group_entry));
 
-  gtk_list_store_append (priv->group_store, &iter);
-  gtk_list_store_set (priv->group_store, &iter,
+  gtk_list_store_insert_with_values (priv->group_store, NULL, -1,
       COL_NAME, group,
       COL_ENABLED, TRUE,
       -1);