summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Crequy <alban.crequy@collabora.co.uk>2010-12-15 16:36:04 +0000
committerAlban Crequy <alban.crequy@collabora.co.uk>2010-12-15 16:36:04 +0000
commitf20099f8ebaaf27af35707abb5c0371b48d111f8 (patch)
tree10fdaaba620b44b6accb1d6e00ed5394af7d4446
parent0d27ccb1c72fe414551d7c707f287cef822fe6b4 (diff)
Remove Individuals from the model as asked by folks
-rw-r--r--liszt/main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/liszt/main.c b/liszt/main.c
index 00f5092c3..38bfeaeb7 100644
--- a/liszt/main.c
+++ b/liszt/main.c
@@ -9,6 +9,22 @@ enum
N_COLUMNS
};
+static gboolean
+model_delete_cb (ClutterModel *model,
+ ClutterModelIter *iter,
+ gpointer user_data)
+{
+ gpointer current_individual;
+ clutter_model_iter_get (iter, COLUMN_INDIVIDUAL, &current_individual, -1);
+ if (current_individual == user_data)
+ {
+ clutter_model_remove (model, clutter_model_iter_get_row (iter));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
static void
aggregator_individuals_changed_cb (FolksIndividualAggregator *aggregator,
GList *added,
@@ -20,6 +36,15 @@ aggregator_individuals_changed_cb (FolksIndividualAggregator *aggregator,
{
GList *l;
+ for (l = removed; l != NULL; l = l->next)
+ {
+ FolksIndividual *individual = l->data;
+
+ if (folks_individual_get_is_user (individual))
+ continue;
+
+ clutter_model_foreach (model, model_delete_cb, individual);
+ }
for (l = added; l != NULL; l = l->next)
{
FolksIndividual *individual = l->data;