Merge lp:~larsu/indicator-messages/update-root-action into lp:indicator-messages/15.04

Proposed by Lars Karlitski
Status: Merged
Approved by: Ted Gould
Approved revision: 445
Merged at revision: 446
Proposed branch: lp:~larsu/indicator-messages/update-root-action
Merge into: lp:indicator-messages/15.04
Diff against target: 50 lines (+9/-10)
1 file modified
src/im-application-list.c (+9/-10)
To merge this branch: bzr merge lp:~larsu/indicator-messages/update-root-action
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+258170@code.launchpad.net

Commit message

application list: update root action unconditionally

Description of the change

application list: update root action unconditionally

Until now, the _update_root_action() was only called when the draws_attention was set. That function now also sets the sensitive state of some other actions, which might change independently of the attention flag.

Simply call the function unconditionally. It's not doing a lot of work anyway and it only gets called when something in the source or message lists changes.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
445. By Lars Karlitski

application list: update root action unconditionally

Until now, the _update_root_action() was only called when the
draws_attention was set. That function now also sets the sensitive state
of some other actions, which might change independently of the attention
flag.

Simply call the function unconditionally. It's not doing a lot of work
anyway and it only gets called when something in the source or message
lists changes.

Revision history for this message
Lars Karlitski (larsu) wrote :

I accidentally removed the calls to update_attention() as well, which was fortunately caught by the test.

Amended the commit to do the right thing.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

Cool, thanks for running this correctly Jenkins :-/

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/im-application-list.c'
2--- src/im-application-list.c 2015-04-03 14:51:51 +0000
3+++ src/im-application-list.c 2015-05-04 17:32:32 +0000
4@@ -352,8 +352,8 @@
5 g_action_map_remove_action (G_ACTION_MAP(app->source_actions), action_name);
6 g_signal_emit (app->list, signals[SOURCE_REMOVED], 0, app->id, action_name);
7
8- if (application_update_draws_attention(app))
9- im_application_list_update_root_action (app->list);
10+ application_update_draws_attention (app);
11+ im_application_list_update_root_action (app->list);
12 }
13
14 /* Remove a source from an application, signal up and update the status
15@@ -410,8 +410,8 @@
16 g_action_map_remove_action (G_ACTION_MAP(app->message_actions), action_name);
17 g_action_muxer_remove (app->message_sub_actions, action_name);
18
19- if (application_update_draws_attention(app))
20- im_application_list_update_root_action (app->list);
21+ application_update_draws_attention (app);
22+ im_application_list_update_root_action (app->list);
23
24 g_signal_emit (app->list, signals[MESSAGE_REMOVED], 0, app->id, action_name);
25 }
26@@ -912,10 +912,9 @@
27 g_signal_emit (app->list, signals[SOURCE_ADDED], 0, app->id, action_name, label, serialized_icon, visible);
28
29 if (visible && draws_attention && app->draws_attention == FALSE)
30- {
31- app->draws_attention = TRUE;
32- im_application_list_update_root_action (app->list);
33- }
34+ app->draws_attention = TRUE;
35+
36+ im_application_list_update_root_action (app->list);
37
38 g_free (action_name);
39 g_object_unref (action);
40@@ -954,8 +953,8 @@
41
42 g_signal_emit (app->list, signals[SOURCE_CHANGED], 0, app->id, action_name, label, serialized_icon, visible);
43
44- if (application_update_draws_attention (app))
45- im_application_list_update_root_action (app->list);
46+ application_update_draws_attention (app);
47+ im_application_list_update_root_action (app->list);
48
49 if (serialized_icon)
50 g_variant_unref (serialized_icon);

Subscribers

People subscribed via source and target branches