~larsu/indicator-messages/set-status-return-value

« back to all changes in this revision

Viewing changes to src/im-application-list.c

  • Committer: Tarmac
  • Author(s): Lars Uebernickel
  • Date: 2013-08-27 14:28:43 UTC
  • mfrom: (362.2.3 trunk)
  • Revision ID: tarmac-20130827142843-ygdaown2ztf60hdp
Fix bug #1216843

Remove all sources when an applications quits and don't show sources with a count of 0. Fixes: https://bugs.launchpad.net/bugs/1216843.

Approved by Charles Kerr, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
476
476
                                          NULL, NULL,
477
477
                                          g_cclosure_marshal_generic,
478
478
                                          G_TYPE_NONE,
479
 
                                          4,
480
 
                                          G_TYPE_STRING,
481
 
                                          G_TYPE_STRING,
482
 
                                          G_TYPE_STRING,
483
 
                                          G_TYPE_STRING);
 
479
                                          5,
 
480
                                          G_TYPE_STRING,
 
481
                                          G_TYPE_STRING,
 
482
                                          G_TYPE_STRING,
 
483
                                          G_TYPE_STRING,
 
484
                                          G_TYPE_BOOLEAN);
484
485
 
485
486
  signals[SOURCE_REMOVED] = g_signal_new ("source-removed",
486
487
                                          IM_TYPE_APPLICATION_LIST,
539
540
                                       G_SIGNAL_RUN_FIRST,
540
541
                                       0,
541
542
                                       NULL, NULL,
542
 
                                       g_cclosure_marshal_VOID__OBJECT,
 
543
                                       g_cclosure_marshal_VOID__STRING,
543
544
                                       G_TYPE_NONE,
544
545
                                       1,
545
546
                                       G_TYPE_STRING);
806
807
  const gchar *string;
807
808
  gboolean draws_attention;
808
809
  gboolean old_draw;
 
810
  gboolean visible;
809
811
 
810
812
  g_variant_get (source, "(&s&s&sux&sb)",
811
813
                 &id, &label, &iconstr, &count, &time, &string, &draws_attention);
815
817
  g_action_group_change_action_state (G_ACTION_GROUP (app->source_actions), id,
816
818
                                      g_variant_new ("(uxsb)", count, time, string, draws_attention));
817
819
 
818
 
  g_signal_emit (app->list, signals[SOURCE_CHANGED], 0, app->id, id, label, iconstr);
819
 
 
820
 
  if (!old_draw && draws_attention)
 
820
  visible = count > 0;
 
821
 
 
822
  g_signal_emit (app->list, signals[SOURCE_CHANGED], 0, app->id, id, label, iconstr, visible);
 
823
 
 
824
  if (visible && !old_draw && draws_attention)
821
825
    app->draws_attention = TRUE;
822
826
 
823
827
  im_application_list_update_draws_attention (app->list);