Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
[GDesktopAppInfo] New function g_desktop_app_info_get_filename
Browse files Browse the repository at this point in the history
This allows access to the full file path, where possible.

https://bugzilla.gnome.org/show_bug.cgi?id=612832
  • Loading branch information
cgwalters committed Mar 14, 2010
1 parent 1be8ad3 commit f552689
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/reference/gio/gio-sections.txt
Expand Up @@ -1391,6 +1391,7 @@ GDesktopAppInfo
g_desktop_app_info_new_from_filename
g_desktop_app_info_new_from_keyfile
g_desktop_app_info_new
g_desktop_app_info_get_filename
g_desktop_app_info_get_is_hidden
g_desktop_app_info_set_desktop_env
GDesktopAppInfoLookup
Expand Down
17 changes: 17 additions & 0 deletions gio/gdesktopappinfo.c
Expand Up @@ -494,6 +494,23 @@ g_desktop_app_info_get_is_hidden (GDesktopAppInfo *info)
return info->hidden;
}

/**
* g_desktop_app_info_get_filename:
* @info: a #GDesktopAppInfo
*
* When @info was created from a known filename, return it. In some
* situations such as the #GDesktopAppInfo returned from
* g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
*
* Returns: The full path to the file for @info, or %NULL if not known.
* Since: 2.24
*/
const char *
g_desktop_app_info_get_filename (GDesktopAppInfo *info)
{
return info->filename;
}

static const char *
g_desktop_app_info_get_description (GAppInfo *appinfo)
{
Expand Down
2 changes: 2 additions & 0 deletions gio/gdesktopappinfo.h
Expand Up @@ -48,6 +48,8 @@ GType g_desktop_app_info_get_type (void) G_GNUC_CONST;
GDesktopAppInfo *g_desktop_app_info_new_from_filename (const char *filename);
GDesktopAppInfo *g_desktop_app_info_new_from_keyfile (GKeyFile *key_file);

const char * g_desktop_app_info_get_filename (GDesktopAppInfo *info);

GDesktopAppInfo *g_desktop_app_info_new (const char *desktop_id);
gboolean g_desktop_app_info_get_is_hidden (GDesktopAppInfo *info);

Expand Down
1 change: 1 addition & 0 deletions gio/gio.symbols
Expand Up @@ -75,6 +75,7 @@ g_app_info_reset_type_associations
g_desktop_app_info_new_from_filename
g_desktop_app_info_new_from_keyfile
g_desktop_app_info_new
g_desktop_app_info_get_filename
g_desktop_app_info_get_type G_GNUC_CONST
g_desktop_app_info_get_is_hidden
g_desktop_app_info_set_desktop_env
Expand Down

0 comments on commit f552689

Please sign in to comment.