From f37cabbdae0fe452f5bd333c454171e70a993500 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 13 Feb 2009 11:59:38 -0600 Subject: Adding in desktop file support, which required configure changes to get the right headers. --- src/app-menu-item.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/app-menu-item.c b/src/app-menu-item.c index 01fd25b..bf6fe8a 100644 --- a/src/app-menu-item.c +++ b/src/app-menu-item.c @@ -26,6 +26,7 @@ with this program. If not, see . #include #include +#include #include "app-menu-item.h" typedef struct _AppMenuItemPrivate AppMenuItemPrivate; @@ -36,7 +37,7 @@ struct _AppMenuItemPrivate IndicateListenerServer * server; gchar * type; - gchar * desktop; + GAppInfo * appinfo; GtkWidget * name; }; @@ -77,7 +78,7 @@ app_menu_item_init (AppMenuItem *self) priv->server = NULL; priv->name = NULL; priv->type = NULL; - priv->desktop = NULL; + priv->appinfo = NULL; return; @@ -140,11 +141,14 @@ desktop_cb (IndicateListener * listener, IndicateListenerServer * server, gchar AppMenuItem * self = APP_MENU_ITEM(data); AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self); - if (priv->desktop != NULL) { - g_free(priv->desktop); + if (priv->appinfo != NULL) { + g_object_unref(G_OBJECT(priv->appinfo)); } - priv->desktop = g_strdup(value); + priv->appinfo = G_APP_INFO(g_desktop_app_info_new_from_filename(value)); + g_return_if_fail(priv->appinfo != NULL); + + gtk_label_set_text(GTK_LABEL(priv->name), g_app_info_get_name(priv->appinfo)); return; } -- cgit v1.2.3