summaryrefslogtreecommitdiff
path: root/caja
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2015-10-04 13:28:30 +0200
committerWolfgang Ulbrich <[email protected]>2015-10-04 13:28:30 +0200
commit8f37a8a9a7496b8018e508594507df92f475608d (patch)
tree77a7287737d770db02b56fa07a0b7ba8f534bd23 /caja
parent8c1c9d11b221b7f07c32b89d6d5bde8892d8eb34 (diff)
parent9422315606cd5a8c396bcccbd6a8d8b88a7ad8f8 (diff)
downloadengrampa-8f37a8a9a7496b8018e508594507df92f475608d.tar.bz2
engrampa-8f37a8a9a7496b8018e508594507df92f475608d.tar.xz
Merge pull request #100 from sc0w/master
Fixes: Cannot extract multiple files concurrently to a separate directory
Diffstat (limited to 'caja')
-rw-r--r--caja/caja-engrampa.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/caja/caja-engrampa.c b/caja/caja-engrampa.c
index 0955201..6247609 100644
--- a/caja/caja-engrampa.c
+++ b/caja/caja-engrampa.c
@@ -38,26 +38,32 @@ static void
extract_to_callback (CajaMenuItem *item,
gpointer user_data)
{
- GList *files;
+ GList *files, *scan;
CajaFileInfo *file;
- char *uri, *default_dir;
- char *quoted_uri, *quoted_default_dir;
+ char *default_dir;
+ char *quoted_default_dir;
GString *cmd;
files = g_object_get_data (G_OBJECT (item), "files");
file = files->data;
- uri = caja_file_info_get_uri (file);
default_dir = caja_file_info_get_parent_uri (file);
- quoted_uri = g_shell_quote (uri);
quoted_default_dir = g_shell_quote (default_dir);
cmd = g_string_new ("engrampa");
- g_string_append_printf (cmd,
- " --default-dir=%s --extract %s",
- quoted_default_dir,
- quoted_uri);
+ g_string_append_printf(cmd," --default-dir=%s --extract", quoted_default_dir);
+
+ for (scan = files; scan; scan = scan->next) {
+ CajaFileInfo *file = scan->data;
+ char *uri, *quoted_uri;
+
+ uri = caja_file_info_get_uri (file);
+ quoted_uri = g_shell_quote (uri);
+ g_string_append_printf (cmd, " %s", quoted_uri);
+ g_free (uri);
+ g_free (quoted_uri);
+ }
#ifdef DEBUG
g_print ("EXEC: %s\n", cmd->str);
@@ -67,9 +73,7 @@ extract_to_callback (CajaMenuItem *item,
g_string_free (cmd, TRUE);
g_free (default_dir);
- g_free (uri);
g_free (quoted_default_dir);
- g_free (quoted_uri);
}