~seb128/indicator-power/unity8-system-settings

« back to all changes in this revision

Viewing changes to src/service.c

  • Committer: CI Train Bot
  • Author(s): Charles Kerr
  • Date: 2015-05-15 16:40:29 UTC
  • mfrom: (284.1.1 trunk-15.04)
  • Revision ID: ci-train-bot@canonical.com-20150515164029-powhkqeuo8tys2oq
Fix timing issue that caused "Adjust brightness automatically" menuitem to sometimes not be shown. Fixes: #1382861
Approved by: PS Jenkins bot, Rodney Dawes

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
  guint actions_export_id;
111
111
  GDBusConnection * conn;
112
112
 
 
113
  gboolean menus_built;
113
114
  struct ProfileMenuInfo menus[N_PROFILES];
114
115
 
115
116
  GSimpleActionGroup * actions;
674
675
      g_simple_action_set_state (p->header_action, create_header_state (self));
675
676
    }
676
677
 
677
 
  if (p->conn == NULL) /* we haven't built the menus yet */
 
678
  if (!p->menus_built)
678
679
    return;
679
680
 
680
681
  if (sections & SECTION_DEVICES)
1184
1185
 
1185
1186
  for (i=0; i<N_PROFILES; ++i)
1186
1187
    create_menu(self, i);
 
1188
  p->menus_built = TRUE;
1187
1189
 
1188
1190
  g_signal_connect_swapped(p->brightness, "notify::auto-brightness-supported",
1189
1191
                           G_CALLBACK(on_auto_brightness_supported_changed), self);