From 51de4ced42e132fa3a66a2739e8a3ba861842467 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 10 Aug 2010 21:19:31 -0500 Subject: Checking for an override and applying it. --- src/application-service-appstore.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 4d21291..d632456 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -346,11 +346,16 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err app->icon_theme_path = g_strdup(""); } - gpointer ordering_index_data = g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ORDERING_INDEX); - if (ordering_index_data == NULL || g_value_get_uint(ordering_index_data) == 0) { - app->ordering_index = generate_id(string_to_status(app->category), app->id); + gpointer ordering_index_over = g_hash_table_lookup(priv->ordering_overrides, app->id); + if (ordering_index_over == NULL) { + gpointer ordering_index_data = g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ORDERING_INDEX); + if (ordering_index_data == NULL || g_value_get_uint(ordering_index_data) == 0) { + app->ordering_index = generate_id(string_to_status(app->category), app->id); + } else { + app->ordering_index = g_value_get_uint(ordering_index_data); + } } else { - app->ordering_index = g_value_get_uint(ordering_index_data); + app->ordering_index = GPOINTER_TO_UINT(ordering_index_over); } gpointer label_data = g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_LABEL); -- cgit v1.2.3