summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Crequy <alban.crequy@collabora.co.uk>2010-12-15 16:39:15 +0000
committerAlban Crequy <alban.crequy@collabora.co.uk>2010-12-15 16:39:15 +0000
commitc2f3cc11974b0ce8896d5907a6c0fe70992dab6f (patch)
tree4ef3786ab0fda1bd6b8e87f556491c31922ff37e
parentf20099f8ebaaf27af35707abb5c0371b48d111f8 (diff)
Enable sorting
-rw-r--r--liszt/main.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/liszt/main.c b/liszt/main.c
index 38bfeaeb7..ddca427be 100644
--- a/liszt/main.c
+++ b/liszt/main.c
@@ -58,7 +58,6 @@ aggregator_individuals_changed_cb (FolksIndividualAggregator *aggregator,
}
}
-/* breaks avatars for now
static gint
model_sort_func (ClutterModel *model,
const GValue *a,
@@ -67,19 +66,23 @@ model_sort_func (ClutterModel *model,
{
FolksIndividual *one = g_value_get_object (a);
FolksIndividual *two = g_value_get_object (b);
+ const gchar *alias1;
+ const gchar *alias2;
gint ret;
- ret = folks_presence_typecmp (
- folks_presence_get_presence_type (FOLKS_PRESENCE (one)),
- folks_presence_get_presence_type (FOLKS_PRESENCE (two)));
+ ret = - folks_has_presence_typecmp (
+ folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (one)),
+ folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (two)));
if (ret != 0)
return ret;
- return strcmp (folks_aliasable_get_alias (FOLKS_ALIASABLE (one)),
- folks_aliasable_get_alias (FOLKS_ALIASABLE (two)));
+ alias1 = folks_aliasable_get_alias (FOLKS_ALIASABLE (one));
+ alias2 = folks_aliasable_get_alias (FOLKS_ALIASABLE (two));
+ ret = strcmp (alias1, alias2);
+
+ return ret;
}
-*/
static ClutterModel *
create_model (FolksIndividualAggregator *aggregator)
@@ -89,10 +92,8 @@ create_model (FolksIndividualAggregator *aggregator)
model = clutter_list_model_new (N_COLUMNS,
FOLKS_TYPE_INDIVIDUAL, "individual");
- /*
clutter_model_set_sort (model, COLUMN_INDIVIDUAL, model_sort_func,
NULL, NULL);
- */
folks_individual_aggregator_prepare (aggregator, NULL, NULL);