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
This commit is contained in:
Vincent Untz 2011-06-12 12:22:59 +02:00
parent 9a9cca9764
commit 86ffdf5570
2 changed files with 22 additions and 0 deletions

View File

@ -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);

View File

@ -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);