summaryrefslogtreecommitdiff
path: root/libnautilus-extensions
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2001-04-30 22:17:36 +0000
committerDarin Adler <darin@src.gnome.org>2001-04-30 22:17:36 +0000
commit2b047e6f12e2625330f72cc919979971726d8fc1 (patch)
tree76f41541afb483a5e4a291b0f82f2048552654e8 /libnautilus-extensions
parentdb591a9924bfb6128b6d9b492633b0d700da9347 (diff)
downloadnautilus-2b047e6f12e2625330f72cc919979971726d8fc1.tar.gz
reviewed by: John Sullivan <sullivan@eazel.com>
Updated for eel changes needed to fix bug 8198 ("New Terminal" does not use GNOME default applications): * libnautilus-extensions/nautilus-link.c: (nautilus_link_local_create_from_gnome_entry): Use the new eel_gnome_make_terminal_command instead of the obsolete eel_gnome_get_terminal_path. * libnautilus-extensions/nautilus-program-choosing.c: (nautilus_launch_application_from_command): Let eel do the /bin/sh -c trick. Get rid of it from here.
Diffstat (limited to 'libnautilus-extensions')
-rw-r--r--libnautilus-extensions/nautilus-link.c32
-rw-r--r--libnautilus-extensions/nautilus-program-choosing.c6
2 files changed, 14 insertions, 24 deletions
diff --git a/libnautilus-extensions/nautilus-link.c b/libnautilus-extensions/nautilus-link.c
index f53cde8a5..8d00b5bef 100644
--- a/libnautilus-extensions/nautilus-link.c
+++ b/libnautilus-extensions/nautilus-link.c
@@ -31,6 +31,7 @@
#include "nautilus-file.h"
#include "nautilus-metadata.h"
#include "nautilus-file-utilities.h"
+#include <eel/eel-glib-extensions.h>
#include <eel/eel-gnome-extensions.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
@@ -497,8 +498,8 @@ void
nautilus_link_local_create_from_gnome_entry (GnomeDesktopEntry *entry, const char *dest_path, const GdkPoint *position)
{
const char *icon_name;
- char *launch_string, *terminal_path;
- char *arguments, *temp_str;
+ char *launch_string, *terminal_command;
+ char *quoted, *arguments, *temp_str;
gboolean create_link;
int index;
@@ -506,34 +507,28 @@ nautilus_link_local_create_from_gnome_entry (GnomeDesktopEntry *entry, const cha
return;
}
- terminal_path = eel_gnome_get_terminal_path ();
- if (terminal_path == NULL) {
- return;
- }
-
create_link = TRUE;
/* Extract arguments from exec array */
for (index = 0, arguments = NULL; index < entry->exec_length; ++index) {
+ quoted = eel_shell_quote (entry->exec[index]);
if (arguments == NULL) {
- arguments = g_strdup (entry->exec[index]);
+ arguments = quoted;
} else {
temp_str = arguments;
- arguments = g_strdup_printf ("%s %s", temp_str, entry->exec[index]);
+ arguments = g_strdup_printf ("%s %s", temp_str, quoted);
g_free (temp_str);
- }
+ g_free (quoted);
+ }
}
if (strcmp (entry->type, "Application") == 0) {
- if (entry->terminal) {
- if (strstr (terminal_path, "gnome-terminal") != NULL) {
- /* gnome-terminal takes different arguments */
- launch_string = g_strdup_printf ("command:%s '-x %s'", terminal_path, arguments);
- } else {
- launch_string = g_strdup_printf ("command:%s '-e %s'", terminal_path, arguments);
- }
+ if (entry->terminal) {
+ terminal_command = eel_gnome_make_terminal_command (arguments);
+ launch_string = g_strconcat ("command:", terminal_command, NULL);
+ g_free (terminal_command);
} else {
- launch_string = g_strdup_printf ("command:%s", arguments);
+ launch_string = g_strconcat ("command:", arguments, NULL);
}
} else if (strcmp (entry->type, "URL") == 0) {
launch_string = g_strdup (arguments);
@@ -556,6 +551,5 @@ nautilus_link_local_create_from_gnome_entry (GnomeDesktopEntry *entry, const cha
g_free (launch_string);
g_free (arguments);
- g_free (terminal_path);
}
diff --git a/libnautilus-extensions/nautilus-program-choosing.c b/libnautilus-extensions/nautilus-program-choosing.c
index 67c87064e..92f67b6af 100644
--- a/libnautilus-extensions/nautilus-program-choosing.c
+++ b/libnautilus-extensions/nautilus-program-choosing.c
@@ -655,7 +655,6 @@ nautilus_launch_application_from_command (const char *name,
{
char *full_command;
char *quoted_parameter;
- char *quoted_full_command;
char *final_command;
char *xalf_prefix;
@@ -670,11 +669,8 @@ nautilus_launch_application_from_command (const char *name,
xalf_prefix = get_xalf_prefix (name);
if (use_terminal) {
- quoted_full_command = eel_shell_quote (full_command);
- final_command = g_strconcat (xalf_prefix, "/bin/sh -c ",
- quoted_full_command, NULL);
+ final_command = g_strconcat (xalf_prefix, full_command, NULL);
eel_gnome_open_terminal (final_command);
- g_free (quoted_full_command);
} else {
final_command = g_strconcat (xalf_prefix, full_command, " &", NULL);
system (final_command);