glib r7706 - in trunk: docs/reference docs/reference/gio gio
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r7706 - in trunk: docs/reference docs/reference/gio gio
- Date: Fri, 28 Nov 2008 23:16:45 +0000 (UTC)
Author: matthiasc
Date: Fri Nov 28 23:16:45 2008
New Revision: 7706
URL: http://svn.gnome.org/viewvc/glib?rev=7706&view=rev
Log:
* gio.symbols:
* gappinfo.[hc]: Add g_app_info_get_commandline. Requested
by Hans Petter Jansson.
* gdesktopappinfo.c: And implement it here.
Modified:
trunk/docs/reference/ChangeLog
trunk/docs/reference/gio/gio-sections.txt
trunk/gio/ChangeLog
trunk/gio/gappinfo.c
trunk/gio/gappinfo.h
trunk/gio/gdesktopappinfo.c
trunk/gio/gio.symbols
Modified: trunk/docs/reference/gio/gio-sections.txt
==============================================================================
--- trunk/docs/reference/gio/gio-sections.txt (original)
+++ trunk/docs/reference/gio/gio-sections.txt Fri Nov 28 23:16:45 2008
@@ -1066,6 +1066,7 @@
g_app_info_get_name
g_app_info_get_description
g_app_info_get_executable
+g_app_info_get_commandline
g_app_info_get_icon
g_app_info_launch
g_app_info_supports_files
Modified: trunk/gio/gappinfo.c
==============================================================================
--- trunk/gio/gappinfo.c (original)
+++ trunk/gio/gappinfo.c Fri Nov 28 23:16:45 2008
@@ -249,12 +249,12 @@
/**
* g_app_info_get_executable:
- * @appinfo: a #GAppInfo.
+ * @appinfo: a #GAppInfo
*
* Gets the executable's name for the installed application.
*
* Returns: a string containing the @appinfo's application
- * binary's name.
+ * binary's name
**/
const char *
g_app_info_get_executable (GAppInfo *appinfo)
@@ -270,6 +270,33 @@
/**
+ * g_app_info_get_commandline:
+ * @appinfo: a #GAppInfo
+ *
+ * Gets the commandline with which the application will be
+ * started.
+ *
+ * Returns: a string containing the @appinfo's commandline,
+ * or %NULL if this information is not available
+ *
+ * Since: 2.20
+ **/
+const char *
+g_app_info_get_commandline (GAppInfo *appinfo)
+{
+ GAppInfoIface *iface;
+
+ g_return_val_if_fail (G_IS_APP_INFO (appinfo), NULL);
+
+ iface = G_APP_INFO_GET_IFACE (appinfo);
+
+ if (iface->get_commandline)
+ return (* iface->get_commandline) (appinfo);
+
+ return NULL;
+}
+
+/**
* g_app_info_set_as_default_for_type:
* @appinfo: a #GAppInfo.
* @content_type: the content type.
Modified: trunk/gio/gappinfo.h
==============================================================================
--- trunk/gio/gappinfo.h (original)
+++ trunk/gio/gappinfo.h Fri Nov 28 23:16:45 2008
@@ -124,6 +124,7 @@
GError **error);
gboolean (* can_delete) (GAppInfo *appinfo);
gboolean (* do_delete) (GAppInfo *appinfo);
+ const char * (* get_commandline) (GAppInfo *appinfo);
};
GType g_app_info_get_type (void) G_GNUC_CONST;
@@ -138,6 +139,7 @@
const char *g_app_info_get_name (GAppInfo *appinfo);
const char *g_app_info_get_description (GAppInfo *appinfo);
const char *g_app_info_get_executable (GAppInfo *appinfo);
+const char *g_app_info_get_commandline (GAppInfo *appinfo);
GIcon * g_app_info_get_icon (GAppInfo *appinfo);
gboolean g_app_info_launch (GAppInfo *appinfo,
GList *files,
Modified: trunk/gio/gdesktopappinfo.c
==============================================================================
--- trunk/gio/gdesktopappinfo.c (original)
+++ trunk/gio/gdesktopappinfo.c Fri Nov 28 23:16:45 2008
@@ -479,6 +479,14 @@
return info->binary;
}
+static const char *
+g_desktop_app_info_get_commandline (GAppInfo *appinfo)
+{
+ GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
+
+ return info->exec;
+}
+
static GIcon *
g_desktop_app_info_get_icon (GAppInfo *appinfo)
{
@@ -1745,6 +1753,7 @@
iface->remove_supports_type = g_desktop_app_info_remove_supports_type;
iface->can_delete = g_desktop_app_info_can_delete;
iface->do_delete = g_desktop_app_info_delete;
+ iface->get_commandline = g_desktop_app_info_get_commandline;
}
static gboolean
Modified: trunk/gio/gio.symbols
==============================================================================
--- trunk/gio/gio.symbols (original)
+++ trunk/gio/gio.symbols Fri Nov 28 23:16:45 2008
@@ -36,6 +36,7 @@
g_app_info_get_name
g_app_info_get_description
g_app_info_get_executable
+g_app_info_get_commandline
g_app_info_get_icon
g_app_info_launch
g_app_info_supports_uris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]