* 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-contact-manager.h>
-
-#include "empathy-groups-widget.h"
-#include "empathy-ui-utils.h"
+#include "empathy-utils.h"
+#include "empathy-connection-aggregator.h"
/**
* SECTION:empathy-groups-widget
EmpathyGroupsWidgetPriv *priv = GET_PRIV (self);
FindNameData data;
- if (EMP_STR_EMPTY (name))
+ if (TPAW_STR_EMPTY (name))
return FALSE;
data.widget = self;
populate_data (EmpathyGroupsWidget *self)
{
EmpathyGroupsWidgetPriv *priv = GET_PRIV (self);
- EmpathyContactManager *manager;
- GtkTreeIter iter;
+ EmpathyConnectionAggregator *aggregator;
GeeSet *member_groups;
GList *all_groups, *l;
/* Remove the old groups */
gtk_list_store_clear (priv->group_store);
- /* FIXME: We have to get the whole group list from EmpathyContactManager, as
- * libfolks hasn't grown API to get the whole group list yet. (bgo#627398) */
- manager = empathy_contact_manager_dup_singleton ();
- all_groups = empathy_contact_list_get_all_groups (
- EMPATHY_CONTACT_LIST (manager));
- g_object_unref (manager);
+ /* FIXME: We have to get the whole group list from
+ * EmpathyConnectionAggregator, as libfolks hasn't grown API to get the whole
+ * group list yet. (bgo#627398) */
+ aggregator = empathy_connection_aggregator_dup_singleton ();
+ all_groups = empathy_connection_aggregator_get_all_groups (aggregator);
+ g_object_unref (aggregator);
/* Get the list of groups that this #FolksGroupDetails is currently in */
member_groups = folks_group_details_get_groups (priv->group_details);
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);
else
{
gtk_widget_set_sensitive (GTK_WIDGET (priv->add_group_button),
- !EMP_STR_EMPTY (group));
+ !TPAW_STR_EMPTY (group));
}
}
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);