Enable file forwarding for %u as well

Do the same Exec line mangling for file forwarding if
we encounter %u or %U. flatpak run is smart enough to
handle file: uris and ignore others.
This commit is contained in:
Matthias Clasen
2017-04-29 08:38:23 -04:00
committed by Alexander Larsson
parent f3bb892868
commit 185de3462c

View File

@@ -3411,7 +3411,8 @@ export_desktop_file (const char *app,
for (i = 1; i < old_argc; i++)
{
if (strcasecmp (old_argv[i], "%f") == 0)
if (strcasecmp (old_argv[i], "%f") == 0 ||
strcasecmp (old_argv[i], "%u") == 0)
{
g_string_append (new_exec, " --file-forwarding");
break;
@@ -3425,7 +3426,8 @@ export_desktop_file (const char *app,
{
g_autofree char *arg = maybe_quote (old_argv[i]);
if (strcasecmp (arg, "%f") == 0)
if (strcasecmp (arg, "%f") == 0 ||
strcasecmp (arg, "%u") == 0)
g_string_append_printf (new_exec, " @@ %s @@", arg);
else
g_string_append_printf (new_exec, " %s", arg);