~ubuntu-branches/ubuntu/trusty/libindicator/trusty-proposed

« back to all changes in this revision

Viewing changes to libindicator/indicator-ng.c

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2013-05-02 22:59:05 UTC
  • mfrom: (1.1.45)
  • Revision ID: package-import@ubuntu.com-20130502225905-cccacbl1790cvcje
Tags: 12.10.2daily13.05.02-0ubuntu1
Automatic snapshot from revision 487

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
indicator_ng_update_entry (IndicatorNg *self)
237
237
{
238
238
  GVariant *state;
 
239
  const gchar *label = NULL;
 
240
  const gchar *iconstr = NULL;
 
241
  const gchar *accessible_desc = NULL;
 
242
  gboolean visible = TRUE;
239
243
 
240
244
  g_return_if_fail (self->menu != NULL);
241
245
  g_return_if_fail (self->actions != NULL);
250
254
  state = g_action_group_get_action_state (self->actions, self->header_action);
251
255
  if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("(sssb)")))
252
256
    {
253
 
      const gchar *label;
254
 
      const gchar *iconstr;
255
 
      const gchar *accessible_desc;
256
 
      gboolean visible;
257
 
 
258
257
      g_variant_get (state, "(&s&s&sb)", &label, &iconstr, &accessible_desc, &visible);
 
258
    }
 
259
  else if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("a{sv}")))
 
260
    {
 
261
      g_variant_lookup (state, "label", "&s", &label);
 
262
      g_variant_lookup (state, "icon", "&s", &iconstr);
 
263
      g_variant_lookup (state, "accessible-desc", "&s", &accessible_desc);
 
264
      g_variant_lookup (state, "visible", "b", &visible);
 
265
    }
 
266
  else
 
267
    g_warning ("the action of the indicator menu item must have state with type (sssb) or a{sv}");
259
268
 
260
 
      indicator_ng_set_label (self, label);
 
269
  if (label)
 
270
    indicator_ng_set_label (self, label);
 
271
  if (iconstr)
261
272
      indicator_ng_set_icon_from_string (self, iconstr);
262
 
      indicator_ng_set_accessible_desc (self, accessible_desc);
263
 
      indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
264
 
    }
265
 
  else
266
 
    g_warning ("the action of the indicator menu item must have state with type (sssb)");
 
273
  if (accessible_desc)
 
274
    indicator_ng_set_accessible_desc (self, accessible_desc);
 
275
  indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
267
276
 
268
277
  if (state)
269
278
    g_variant_unref (state);