From 6ff29c1deaef7936a535878996f92bf3a499f349 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 29 Jan 2008 15:47:27 +0000 Subject: [PATCH] Add G_APP_INFO_CREATE_SUPPORTS_URIS flag 2008-01-29 Alexander Larsson * gappinfo.h: * gdesktopappinfo.c: Add G_APP_INFO_CREATE_SUPPORTS_URIS flag svn path=/trunk/; revision=6418 --- gio/ChangeLog | 6 ++++++ gio/gappinfo.h | 4 +++- gio/gdesktopappinfo.c | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 9a6f817..5326389 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,5 +1,11 @@ 2008-01-29 Alexander Larsson + * gappinfo.h: + * gdesktopappinfo.c: + Add G_APP_INFO_CREATE_SUPPORTS_URIS flag + +2008-01-29 Alexander Larsson + * gdesktopappinfo.c: * gdesktopappinfo.h: giomodule-priv.h include moved to .c file. diff --git a/gio/gappinfo.h b/gio/gappinfo.h index da5d34d..0f51dc5 100644 --- a/gio/gappinfo.h +++ b/gio/gappinfo.h @@ -48,12 +48,14 @@ G_BEGIN_DECLS * GAppInfoCreateFlags: * @G_APP_INFO_CREATE_NONE: No flags. * @G_APP_INFO_CREATE_NEEDS_TERMINAL: Application opens in a terminal window. + * @G_APP_INFO_CREATE_SUPPORTS_URIS: Application supports URI arguments. * * Flags used when creating a #GAppInfo. */ typedef enum { G_APP_INFO_CREATE_NONE = 0, /*< nick=none >*/ - G_APP_INFO_CREATE_NEEDS_TERMINAL = (1<<0) /*< nick=needs-terminal >*/ + G_APP_INFO_CREATE_NEEDS_TERMINAL = (1<<0), /*< nick=needs-terminal >*/ + G_APP_INFO_CREATE_SUPPORTS_URIS = (1<<1) /*< nick=supports-uris >*/ } GAppInfoCreateFlags; typedef struct _GAppLaunchContext GAppLaunchContext; diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 18dce34..8725075 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -1508,7 +1508,10 @@ g_app_info_create_from_commandline (const char *commandline, info->terminal = flags & G_APP_INFO_CREATE_NEEDS_TERMINAL; info->startup_notify = FALSE; info->hidden = FALSE; - info->exec = g_strconcat (commandline, " %f", NULL); + if (flags & G_APP_INFO_CREATE_SUPPORTS_URIS) + info->exec = g_strconcat (commandline, " %u", NULL); + else + info->exec = g_strconcat (commandline, " %f", NULL); info->comment = g_strdup_printf (_("Custom definition for %s"), info->name); info->nodisplay = TRUE; info->binary = binary_from_exec (info->exec); -- 2.7.4