gnome-commander r1542 - in trunk: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1542 - in trunk: . src
- Date: Tue, 22 Jan 2008 21:24:28 +0000 (GMT)
Author: epiotr
Date: Tue Jan 22 21:24:28 2008
New Revision: 1542
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1542&view=rev
Log:
Run 'Open with other...' application in file's directory
Modified:
trunk/ChangeLog
trunk/src/gnome-cmd-file-popmenu.cc
Modified: trunk/src/gnome-cmd-file-popmenu.cc
==============================================================================
--- trunk/src/gnome-cmd-file-popmenu.cc (original)
+++ trunk/src/gnome-cmd-file-popmenu.cc Tue Jan 22 21:24:28 2008
@@ -114,10 +114,7 @@
}
-static gboolean
-on_open_with_other_ok (GnomeCmdStringDialog *string_dialog,
- const gchar **values,
- GList *files)
+static gboolean on_open_with_other_ok (GnomeCmdStringDialog *string_dialog, const gchar **values, GList *files)
{
GtkWidget *term_check = lookup_widget (GTK_WIDGET (string_dialog), "term_check");
@@ -127,21 +124,19 @@
return FALSE;
}
- gchar *cmd = g_strdup_printf ("%s ", values[0]);
+ string cmd = values[0];
for (; files; files = files->next)
{
- gchar *path = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (files->data));
- gchar *tmp = cmd;
- gchar *arg = g_shell_quote (path);
- cmd = g_strdup_printf ("%s %s", tmp, arg);
- g_free (arg);
- g_free (path);
- g_free (tmp);
+ cmd += ' ';
+ cmd += stringify (gnome_cmd_file_get_quoted_real_path (GNOME_CMD_FILE (files->data)));
}
- run_command (cmd, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (term_check)));
- g_free (cmd);
+ GnomeCmdFileSelector *fs = gnome_cmd_main_win_get_fs (main_win, ACTIVE);
+ GnomeCmdDir *dir = gnome_cmd_file_selector_get_directory (fs);
+ gchar *dpath = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dir));
+ run_command_indir (cmd.c_str(), dpath, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (term_check)));
+ g_free (dpath);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]