diff options
author | Ted Gould <ted@gould.cx> | 2010-03-04 00:48:29 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-04 00:48:29 -0600 |
commit | b446b6a118bd0238378d4df5cd4138a242cad59c (patch) | |
tree | a03dc310e0311da9196e228a6bb0dcc85c090277 | |
parent | 3c0e73c7ec818b6759a7805abe07909296791908 (diff) | |
download | ayatana-indicator-messages-b446b6a118bd0238378d4df5cd4138a242cad59c.tar.gz ayatana-indicator-messages-b446b6a118bd0238378d4df5cd4138a242cad59c.tar.bz2 ayatana-indicator-messages-b446b6a118bd0238378d4df5cd4138a242cad59c.zip |
Checking to see if we have a default name.
-rw-r--r-- | src/launcher-menu-item.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c index 07b0546..5cc7cfe 100644 --- a/src/launcher-menu-item.c +++ b/src/launcher-menu-item.c @@ -30,6 +30,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <libindicator/indicator-desktop-shortcuts.h> #include "launcher-menu-item.h" #include "dbus-data.h" +#include "default-applications.h" enum { NAME_CHANGED, @@ -161,7 +162,14 @@ launcher_menu_item_new (const gchar * desktop_file) /* Set the appropriate values on this menu item based on the app info that we've parsed */ g_debug("\tName: %s", launcher_menu_item_get_name(self)); - dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, launcher_menu_item_get_name(self)); + + const gchar * default_name = get_default_name(desktop_file); + if (default_name == NULL) { + dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, launcher_menu_item_get_name(self)); + } else { + dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, default_name); + } + gchar * iconstr = launcher_menu_item_get_icon(self); dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, iconstr); g_free(iconstr); |