[file-roller] Handle relative paths in cmdline arguments better



commit 5588effab70f86638eab0435e054d5450e901e68
Author: Andreas Henriksson <andreas fatal se>
Date:   Sat Aug 10 03:22:22 2013 +0200

    Handle relative paths in cmdline arguments better
    
    File-roller didn't take into account that the
    working directory might have changed between
    opening the first instance and opening additional
    archives on the command line with relative paths.
    
    When a relative path was used for an archive
    on the command line, it would always be relative
    to the first instance working directory - not to
    the launched instance working directory.
    
    This is fixed by using the recently added
    g_application_command_line_create_file_for_arg ()
    (in gio since 2.36).
    
    Problem reported by John Stumpo <stump stump io>
    in http://bugs.debian.org/718672
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705746

 configure.ac         |    2 +-
 src/fr-application.c |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4d1b3ba..7206551 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
 AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
 
 GLIB_REQUIRED=2.36.0
-GIO_REQUIRED=2.25.5
+GIO_REQUIRED=2.36.0
 GTK_REQUIRED=3.9.3
 NAUTILUS_REQUIRED=2.22.2
 JSON_GLIB_REQUIRED=0.14.0
diff --git a/src/fr-application.c b/src/fr-application.c
index 5909844..60ea595 100644
--- a/src/fr-application.c
+++ b/src/fr-application.c
@@ -656,13 +656,13 @@ fr_application_command_line (GApplication            *application,
        }
 
        if (arg_extract_to != NULL)
-               extraction_destination = g_file_new_for_commandline_arg (arg_extract_to);
+               extraction_destination = g_application_command_line_create_file_for_arg (command_line, 
arg_extract_to);
 
        if (arg_add_to != NULL)
-               add_to_archive = g_file_new_for_commandline_arg (arg_add_to);
+               add_to_archive = g_application_command_line_create_file_for_arg (command_line, arg_add_to);
 
        if (arg_default_dir != NULL)
-               default_directory = g_file_new_for_commandline_arg (arg_default_dir);
+               default_directory = g_application_command_line_create_file_for_arg (command_line, 
arg_default_dir);
 
        if ((arg_add_to != NULL) || (arg_add == 1)) { /* Add files to an archive */
                GtkWidget   *window;
@@ -677,7 +677,7 @@ fr_application_command_line (GApplication            *application,
 
                file_list = NULL;
                while ((filename = remaining_args[i++]) != NULL)
-                       file_list = g_list_prepend (file_list, g_file_new_for_commandline_arg (filename));
+                       file_list = g_list_prepend (file_list, g_application_command_line_create_file_for_arg 
(command_line, filename));
                file_list = g_list_reverse (file_list);
 
                fr_window_new_batch (FR_WINDOW (window), _("Compress"));
@@ -708,7 +708,7 @@ fr_application_command_line (GApplication            *application,
                while ((archive = remaining_args[i++]) != NULL) {
                        GFile *file;
 
-                       file = g_file_new_for_commandline_arg (archive);
+                       file = g_application_command_line_create_file_for_arg (command_line, archive);
                        if (arg_extract_here == 1)
                                fr_window_set_batch__extract_here (FR_WINDOW (window), file);
                        else
@@ -734,7 +734,7 @@ fr_application_command_line (GApplication            *application,
                        window = fr_window_new ();
                        gtk_widget_show (window);
 
-                       file = g_file_new_for_commandline_arg (filename);
+                       file = g_application_command_line_create_file_for_arg (command_line, filename);
                        fr_window_archive_open (FR_WINDOW (window), file, GTK_WINDOW (window));
 
                        g_object_unref (file);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]