aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-22 09:54:36 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-22 09:54:36 -0500
commitdd5f50b07bea7a5dec515a753cf66f060e1d79c6 (patch)
tree66a3b855231b9c737b1d8b80b0c3acea1bf5b378 /src/service.c
parent9c3d863d5e0ebe35ae69dedb5219519f0ced9339 (diff)
downloadayatana-indicator-power-dd5f50b07bea7a5dec515a753cf66f060e1d79c6.tar.gz
ayatana-indicator-power-dd5f50b07bea7a5dec515a753cf66f060e1d79c6.tar.bz2
ayatana-indicator-power-dd5f50b07bea7a5dec515a753cf66f060e1d79c6.zip
when a device changes, update the header action state even if the menus haven't been created yet. This fixes a startup condition found by the tests.
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c
index 23cef84..0cd448b 100644
--- a/src/service.c
+++ b/src/service.c
@@ -595,14 +595,14 @@ rebuild_now (IndicatorPowerService * self, guint sections)
struct ProfileMenuInfo * desktop = &p->menus[PROFILE_DESKTOP];
struct ProfileMenuInfo * greeter = &p->menus[PROFILE_DESKTOP_GREETER];
- if (p->conn == NULL) /* we haven't built the menus yet */
- return;
-
if (sections & SECTION_HEADER)
{
g_simple_action_set_state (p->header_action, create_header_state (self));
}
+ if (p->conn == NULL) /* we haven't built the menus yet */
+ return;
+
if (sections & SECTION_DEVICES)
{
rebuild_section (desktop->submenu, 0, create_desktop_devices_section (self, PROFILE_DESKTOP));