aboutsummaryrefslogtreecommitdiff
path: root/src/app-menu-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-02-13 11:59:38 -0600
committerTed Gould <ted@canonical.com>2009-02-13 11:59:38 -0600
commitf37cabbdae0fe452f5bd333c454171e70a993500 (patch)
tree346508418e964996befd5a88846d4bfd080795c3 /src/app-menu-item.c
parent6205276f08e4fd0af6a295f3a44461a5ccc45dee (diff)
downloadayatana-indicator-messages-f37cabbdae0fe452f5bd333c454171e70a993500.tar.gz
ayatana-indicator-messages-f37cabbdae0fe452f5bd333c454171e70a993500.tar.bz2
ayatana-indicator-messages-f37cabbdae0fe452f5bd333c454171e70a993500.zip
Adding in desktop file support, which required configure changes to get the right headers.
Diffstat (limited to 'src/app-menu-item.c')
-rw-r--r--src/app-menu-item.c14
1 files changed, 9 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>.
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <gio/gdesktopappinfo.h>
#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;
}