[PATCH] application: Restore --new-window functionality



In case of no further arguments, open home folder. Commit
[4e192481] "application: minimal port to handle_local_options()"
removed this, presumably accidentally. It makes clicking the "Files"
from favorites do nothing if Nautilus is already running (and it
always is running in classic mode as it handles desktop).

https://bugzilla.redhat.com/show_bug.cgi?id=1147357
---
 src/nautilus-application.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 88ed0f5..d86dc39 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -844,15 +844,17 @@ nautilus_application_handle_file_args (NautilusApplication *self,
 
        g_variant_dict_lookup (options, G_OPTION_REMAINING, "^a&s", &remaining);
 
-       if (remaining == NULL) {
-               return -1;
-       }
-
        /* Convert args to GFiles */
        file_array = g_ptr_array_new_full (0, g_object_unref);
 
-       for (idx = 0; remaining[idx] != NULL; idx++) {
-               file = g_file_new_for_commandline_arg (remaining[idx]);
+       if (remaining) {
+               for (idx = 0; remaining[idx] != NULL; idx++) {
+                       file = g_file_new_for_commandline_arg (remaining[idx]);
+                       g_ptr_array_add (file_array, file);
+               }
+       } else if (!self->priv->no_default_window &&
+            !g_variant_dict_contains (options, "select")) {
+               file = g_file_new_for_path (g_get_home_dir ());
                g_ptr_array_add (file_array, file);
        }
 
-- 
1.9.3



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