gnome-commander r1576 - in branches/gcmd-1-3: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1576 - in branches/gcmd-1-3: . src
- Date: Fri, 22 Feb 2008 07:02:01 +0000 (GMT)
Author: epiotr
Date: Fri Feb 22 07:02:01 2008
New Revision: 1576
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1576&view=rev
Log:
Set proper exec dir for started MIME applications
Modified:
branches/gcmd-1-3/ChangeLog
branches/gcmd-1-3/src/gnome-cmd-file-popmenu.cc
branches/gcmd-1-3/src/utils.cc
Modified: branches/gcmd-1-3/src/gnome-cmd-file-popmenu.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-popmenu.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-popmenu.cc Fri Feb 22 07:02:01 2008
@@ -59,7 +59,18 @@
inline void exec_with_app (GList *files, GnomeCmdApp *app)
{
- mime_exec_multiple (files, app);
+ guint selected_files = g_list_length (files);
+
+ if (selected_files==1)
+ {
+ GnomeCmdFile *finfo = (GnomeCmdFile *) files->data;
+ mime_exec_single (finfo);
+ gnome_cmd_app_free (app);
+
+ g_list_free (files);
+ }
+ else
+ mime_exec_multiple (files, app);
}
Modified: branches/gcmd-1-3/src/utils.cc
==============================================================================
--- branches/gcmd-1-3/src/utils.cc (original)
+++ branches/gcmd-1-3/src/utils.cc Fri Feb 22 07:02:01 2008
@@ -437,14 +437,16 @@
GnomeCmdApp *app = (GnomeCmdApp *) args[0];
gchar *path = (gchar *) args[1];
+ gchar *dpath = (gchar *) args[2];
string cmd = gnome_cmd_app_get_command (app);
cmd += ' ';
cmd += stringify (g_shell_quote (path));
- run_command (cmd.c_str(), gnome_cmd_app_get_requires_terminal (app));
+ run_command_indir (cmd.c_str(), dpath, gnome_cmd_app_get_requires_terminal (app));
g_free (path);
+ g_free (dpath);
gnome_cmd_app_free (app);
g_free (args);
}
@@ -557,12 +559,13 @@
app = gnome_cmd_app_new_from_vfs_app (vfs_app);
gnome_vfs_mime_application_free (vfs_app);
- args = g_new0 (gpointer, 2);
+ args = g_new0 (gpointer, 3);
if (gnome_cmd_file_is_local (finfo))
{
args[0] = (gpointer) app;
args[1] = (gpointer) g_strdup (gnome_cmd_file_get_real_path (finfo));
+ args[2] = (gpointer) g_path_get_dirname ((gchar *) args[1]); // set exec dir for local files
do_mime_exec_single (args);
}
else
@@ -571,6 +574,7 @@
{
args[0] = (gpointer) app;
args[1] = (gpointer) g_strdup (gnome_cmd_file_get_uri_str (finfo));
+ // args[2] is NULL here (don't set exec dir for remote files)
do_mime_exec_single (args);
}
else
@@ -580,6 +584,7 @@
GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, msg);
TmpDlData *dldata = g_new0 (TmpDlData, 1);
args[0] = (gpointer) app;
+ // args[2] is NULL here (don't set exec dir for temporarily downloaded files)
dldata->finfo = finfo;
dldata->dialog = dialog;
dldata->args = args;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]