[glib] GDesktopAppInfo: Add g_desktop_app_info_get_nodisplay
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GDesktopAppInfo: Add g_desktop_app_info_get_nodisplay
- Date: Tue, 14 Jun 2011 06:54:09 +0000 (UTC)
commit 86ffdf55705ef0f76159707576174227df0c2c3a
Author: Vincent Untz <vuntz gnome org>
Date: Sun Jun 12 12:22:59 2011 +0200
GDesktopAppInfo: Add g_desktop_app_info_get_nodisplay
Necessary for rebasing gnome-menus on top of GDesktopAppInfo.
https://bugzilla.gnome.org/show_bug.cgi?id=652385
gio/gdesktopappinfo.c | 21 +++++++++++++++++++++
gio/gdesktopappinfo.h | 1 +
2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 11b5ed6..dc8e066 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -673,6 +673,24 @@ g_desktop_app_info_get_generic_name (GDesktopAppInfo *info)
return info->generic_name;
}
+/**
+ * g_desktop_app_info_get_nodisplay:
+ * @info: a #GDesktopAppInfo
+ *
+ * Gets the value of the NoDisplay key, which helps determine if the
+ * application info should be shown in menus. See
+ * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
+ *
+ * Returns: The value of the NoDisplay key
+ *
+ * Since: 2.30
+ */
+const char *
+g_desktop_app_info_get_nodisplay (GDesktopAppInfo *info)
+{
+ return info->nodisplay;
+}
+
static char *
expand_macro_single (char macro, char *uri)
{
@@ -1926,6 +1944,9 @@ g_desktop_app_info_ensure_saved (GDesktopAppInfo *info,
if (info->terminal)
g_key_file_set_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_TERMINAL, TRUE);
+ if (info->nodisplay)
+ g_key_file_set_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, TRUE);
g_key_file_set_string (key_file, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_EXEC, info->exec);
diff --git a/gio/gdesktopappinfo.h b/gio/gdesktopappinfo.h
index f44acad..21bb22d 100644
--- a/gio/gdesktopappinfo.h
+++ b/gio/gdesktopappinfo.h
@@ -52,6 +52,7 @@ const char * g_desktop_app_info_get_filename (GDesktopAppInfo *info);
const char * g_desktop_app_info_get_generic_name (GDesktopAppInfo *info);
const char * g_desktop_app_info_get_categories (GDesktopAppInfo *info);
+gbooolean g_desktop_app_info_get_nodisplay (GDesktopAppInfo *info);
GDesktopAppInfo *g_desktop_app_info_new (const char *desktop_id);
gboolean g_desktop_app_info_get_is_hidden (GDesktopAppInfo *info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]