diff options
author | Ted Gould <ted@canonical.com> | 2009-09-03 13:03:32 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-03 13:03:32 -0500 |
commit | cb0e7ca7140a0e25f49a8242775778711f710f40 (patch) | |
tree | 4280de5cb626c5442843aeea61eecce081c51a79 /src/status-service.c | |
parent | fcf8a6cc3c9f27c921578fa0faf80db348e2cce1 (diff) | |
download | ayatana-indicator-session-cb0e7ca7140a0e25f49a8242775778711f710f40.tar.gz ayatana-indicator-session-cb0e7ca7140a0e25f49a8242775778711f710f40.tar.bz2 ayatana-indicator-session-cb0e7ca7140a0e25f49a8242775778711f710f40.zip |
Have a quick check to see if we have something to put there. If not, no menu item.
Diffstat (limited to 'src/status-service.c')
-rw-r--r-- | src/status-service.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/status-service.c b/src/status-service.c index 14d8a34..c35395e 100644 --- a/src/status-service.c +++ b/src/status-service.c @@ -165,10 +165,12 @@ build_user_item (DbusmenuMenuitem * root) while (*walker != '\0' && *walker != ',') { walker++; } *walker = '\0'; - DbusmenuMenuitem * useritem = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(useritem, "label", name); - dbusmenu_menuitem_property_set(useritem, "sensitive", "false"); - dbusmenu_menuitem_child_append(root, useritem); + if (name[0] != '\0') { + DbusmenuMenuitem * useritem = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(useritem, "label", name); + dbusmenu_menuitem_property_set(useritem, "sensitive", "false"); + dbusmenu_menuitem_child_append(root, useritem); + } g_free(name); } else { |