diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2010-03-05 00:26:41 +0100 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2010-03-05 00:26:41 +0100 |
commit | 9e9f4726e6414d22611c8b9e6111973ff4a3c0a5 (patch) | |
tree | 23e6f69f8b4d270c679db1e32c7e514d071a25cb /src/launcher-menu-item.c | |
parent | 70d3f9f95831e459b3ff6d3aefaeb27bee392e88 (diff) | |
parent | 36edac8cb9ed2ef0639b38104d6b4455e19cb78c (diff) | |
download | ayatana-indicator-messages-9e9f4726e6414d22611c8b9e6111973ff4a3c0a5.tar.gz ayatana-indicator-messages-9e9f4726e6414d22611c8b9e6111973ff4a3c0a5.tar.bz2 ayatana-indicator-messages-9e9f4726e6414d22611c8b9e6111973ff4a3c0a5.zip |
releasing version 0.3.3-0ubuntu1
Diffstat (limited to 'src/launcher-menu-item.c')
-rw-r--r-- | src/launcher-menu-item.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c index 07b0546..f70f28b 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,8 +162,20 @@ 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)); - gchar * iconstr = launcher_menu_item_get_icon(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; + if (default_name == NULL) { + iconstr = launcher_menu_item_get_icon(self); + } else { + iconstr = g_strdup(get_default_icon(desktop_file)); + } dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, iconstr); g_free(iconstr); dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); |