From d837e88700662ddeec5c01fc724bfe857c30b140 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Fri, 26 May 2006 18:56:39 +0000 Subject: [PATCH] r4585: In many .desktop files there is no "%F" or similar parameter to the "Exec" entry, although the application can open files. Work around this problem by adding the arguments to the end of the command in this case (Dennis Tomas). --- ROX-Filer/src/run.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ROX-Filer/src/run.c b/ROX-Filer/src/run.c index 9d06a7b1..9c8c95ea 100644 --- a/ROX-Filer/src/run.c +++ b/ROX-Filer/src/run.c @@ -566,6 +566,7 @@ static gboolean run_desktop(const char *full_path, gint argc = 0; gchar **argv = NULL; GPtrArray *expanded = NULL; + gboolean inserted_args = FALSE; int i; gboolean success = FALSE; @@ -606,6 +607,7 @@ static gboolean run_desktop(const char *full_path, int j; for (j = 0; args && args[j]; j++) g_ptr_array_add(expanded, g_strdup(args[j])); + inserted_args = TRUE; } else { @@ -619,6 +621,15 @@ static gboolean run_desktop(const char *full_path, g_ptr_array_add(expanded, g_strdup(src)); } } + if (!inserted_args) + { + /* Many .desktop files don't include a % expansion. In that case + * add the arguments here. + */ + int j; + for (j = 0; args && args[j]; j++) + g_ptr_array_add(expanded, g_strdup(args[j])); + } g_ptr_array_add(expanded, NULL); success = rox_spawn(dir, (const gchar **) expanded->pdata); -- 2.11.4.GIT