[glib] [GDesktopAppInfo] New function g_desktop_app_info_get_filename
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] [GDesktopAppInfo] New function g_desktop_app_info_get_filename
- Date: Sun, 14 Mar 2010 19:45:50 +0000 (UTC)
commit f552689058c27ccebaf4271c4a5afc4197b74a8f
Author: Colin Walters <walters verbum org>
Date: Sat Mar 13 18:11:31 2010 -0500
[GDesktopAppInfo] New function g_desktop_app_info_get_filename
This allows access to the full file path, where possible.
https://bugzilla.gnome.org/show_bug.cgi?id=612832
docs/reference/gio/gio-sections.txt | 1 +
gio/gdesktopappinfo.c | 17 +++++++++++++++++
gio/gdesktopappinfo.h | 2 ++
gio/gio.symbols | 1 +
4 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index 057895f..116ab55 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -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
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index e7f214b..97ffee5 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -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)
{
diff --git a/gio/gdesktopappinfo.h b/gio/gdesktopappinfo.h
index 6e51545..48c9693 100644
--- a/gio/gdesktopappinfo.h
+++ b/gio/gdesktopappinfo.h
@@ -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);
diff --git a/gio/gio.symbols b/gio/gio.symbols
index 798ab9a..62a99d7 100644
--- a/gio/gio.symbols
+++ b/gio/gio.symbols
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]