diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-12-14 12:17:09 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-12-14 12:28:21 +0100 |
commit | 8aa21c333115cec5eab0cd3965684b9b09dc7fa3 (patch) | |
tree | 439b69f6b2a873a857f52db9bce72ac9aa2c49ea | |
parent | 14f7dd8cdbbe04b84c2b8f75134cefd45aaf9c4b (diff) | |
download | nautilus-8aa21c333115cec5eab0cd3965684b9b09dc7fa3.tar.gz |
application: streamline code for creating selection list
-rw-r--r-- | src/nautilus-application.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/nautilus-application.c b/src/nautilus-application.c index 7bb55b724..cbfda9562 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -736,29 +736,25 @@ nautilus_application_open_location (NautilusApplication *application, const char *startup_id) { NautilusWindow *window; - GList sel_list; - GList *sel_list_ptr; + GList *sel_list = NULL; window = nautilus_application_create_window (application, gdk_screen_get_default ()); gtk_window_set_startup_id (GTK_WINDOW (window), startup_id); - if (selection) { - sel_list.data = nautilus_file_get (selection); - sel_list.prev = sel_list.next = NULL; - sel_list_ptr = &sel_list; - } else - sel_list_ptr = NULL; + if (selection != NULL) { + sel_list = g_list_prepend (sel_list, nautilus_file_get (selection)); + } nautilus_window_slot_open_location (nautilus_window_get_active_slot (window), location, 0, - sel_list_ptr); + sel_list); - if (sel_list_ptr) - g_object_unref (sel_list.data); + if (sel_list != NULL) { + nautilus_file_list_free (sel_list); + } } - static void nautilus_application_open (GApplication *app, GFile **files, |