diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-04-18 10:26:20 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-04-18 10:26:20 -0500 |
commit | 033cc134729679757e96715e32e0d517143ef49e (patch) | |
tree | 9672c1fe45871e8b8a293f25b3f5d69669889164 /src | |
parent | d87fb5d14091b22eaf6226dc8f9656bd6d514571 (diff) | |
download | ayatana-indicator-session-033cc134729679757e96715e32e0d517143ef49e.tar.gz ayatana-indicator-session-033cc134729679757e96715e32e0d517143ef49e.tar.bz2 ayatana-indicator-session-033cc134729679757e96715e32e0d517143ef49e.zip |
add a small comment explaining replace_section()
Diffstat (limited to 'src')
-rw-r--r-- | src/service.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/service.c b/src/service.c index e62250e..2206621 100644 --- a/src/service.c +++ b/src/service.c @@ -741,8 +741,13 @@ init_gactions (IndicatorSessionService * self) **** ***/ +/** + * A small helper function for rebuild_now(). + * - removes the previous section + * - adds and unrefs the new section + */ static void -replace_section (GMenu * parent, int pos, GMenuModel * new_section) +rebuild_section (GMenu * parent, int pos, GMenuModel * new_section) { g_menu_remove (parent, pos); g_menu_insert_section (parent, pos, NULL, new_section); @@ -763,24 +768,24 @@ rebuild_now (IndicatorSessionService * self, int sections) if (sections & SECTION_ADMIN) { - replace_section (desktop->submenu, 0, create_admin_section()); + rebuild_section (desktop->submenu, 0, create_admin_section()); } if (sections & SECTION_SETTINGS) { - replace_section (desktop->submenu, 1, create_settings_section(self)); + rebuild_section (desktop->submenu, 1, create_settings_section(self)); } if (sections & SECTION_SWITCH) { - replace_section (desktop->submenu, 2, create_switch_section(self)); + rebuild_section (desktop->submenu, 2, create_switch_section(self)); update_switch_actions (self); } if (sections & SECTION_SESSION) { - replace_section (desktop->submenu, 3, create_session_section(self)); - replace_section (greeter->submenu, 0, create_session_section(self)); + rebuild_section (desktop->submenu, 3, create_session_section(self)); + rebuild_section (greeter->submenu, 0, create_session_section(self)); } } |