aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-10-04 14:16:28 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-10-04 14:16:28 +0200
commit5fd82c0139dd0ddddcb3c73b0d9401510229b20a (patch)
tree35d0cdfd4d61f0bf3b3bf183f58b8c41df846893 /src
parentd2b5ddc7a14e19ed7b75dc43d57481b56f543291 (diff)
downloadayatana-indicator-messages-5fd82c0139dd0ddddcb3c73b0d9401510229b20a.tar.gz
ayatana-indicator-messages-5fd82c0139dd0ddddcb3c73b0d9401510229b20a.tar.bz2
ayatana-indicator-messages-5fd82c0139dd0ddddcb3c73b0d9401510229b20a.zip
Rename app_check_draw_attention to app_update_draws_attention
Because it doesn't check the flag, it updates it. Also make the function return whether the flag was changed.
Diffstat (limited to 'src')
-rw-r--r--src/im-application-list.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c
index 1063c8c..dc21aeb 100644
--- a/src/im-application-list.c
+++ b/src/im-application-list.c
@@ -252,13 +252,17 @@ app_message_action_check_draw (Application * app, const gchar * action_name)
}
/* Regenerate the draw attention flag based on the sources and messages
- that we have in the action groups */
-static void
-app_check_draw_attention (Application * app)
+ * that we have in the action groups.
+ *
+ * Returns TRUE if app->draws_attention has changed
+ */
+static gboolean
+application_update_draws_attention (Application * app)
{
gchar **source_actions = NULL;
gchar **message_actions = NULL;
gchar **it;
+ gboolean was_drawing_attention = app->draws_attention;
source_actions = g_action_group_list_actions (G_ACTION_GROUP (app->source_actions));
for (it = source_actions; *it && !app->draws_attention; it++)
@@ -271,7 +275,7 @@ app_check_draw_attention (Application * app)
g_strfreev (source_actions);
g_strfreev (message_actions);
- return;
+ return was_drawing_attention != app->draws_attention;
}
/* Remove a source from an application, signal up and update the status
@@ -284,13 +288,8 @@ im_application_list_source_removed (Application *app,
g_signal_emit (app->list, signals[SOURCE_REMOVED], 0, app->id, id);
- if (app->draws_attention)
- {
- app->draws_attention = FALSE;
- app_check_draw_attention(app);
- }
-
- im_application_list_update_draws_attention (app->list);
+ if (application_update_draws_attention(app))
+ im_application_list_update_draws_attention (app->list);
}
static void