diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-01-13 20:34:09 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-01-18 11:01:43 +0100 |
commit | 2e7da98742faf7ae40b7f953c5daf4cba8ecd384 (patch) | |
tree | 7fa3c35607cd98ce7be5a3edec305eb702b0c2af | |
parent | 70f5cda7ae67d6fa18a683f74559c0827d1cd794 (diff) | |
download | nautilus-2e7da98742faf7ae40b7f953c5daf4cba8ecd384.tar.gz |
window-slot: move cancel_location to stop_loading
Since now they are the same, just use the public api.
https://bugzilla.gnome.org/show_bug.cgi?id=759717
-rw-r--r-- | src/nautilus-window-slot.c | 83 |
1 files changed, 38 insertions, 45 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c index 19991d902..5d2339e75 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -766,7 +766,6 @@ static void begin_location_change (NautilusWindowSlot const char *scroll_pos); static void free_location_change (NautilusWindowSlot *slot); static void end_location_change (NautilusWindowSlot *slot); -static void cancel_location_change (NautilusWindowSlot *slot); static void got_file_info_for_view_selection_callback (NautilusFile *file, gpointer callback_data); static gboolean setup_view (NautilusWindowSlot *slot, @@ -1566,49 +1565,6 @@ free_location_change (NautilusWindowSlot *slot) } } -static void -cancel_location_change (NautilusWindowSlot *slot) -{ - GList *selection; - GFile *location; - NautilusDirectory *directory; - - location = nautilus_window_slot_get_location (slot); - - directory = nautilus_directory_get (slot->details->location); - /* Stops current loading or search if any, so we are not slow */ - if (NAUTILUS_IS_FILES_VIEW (slot->details->content_view)) { - nautilus_files_view_stop_loading (NAUTILUS_FILES_VIEW (slot->details->content_view)); - } - nautilus_directory_unref (directory); - - if (slot->details->pending_location != NULL - && location != NULL - && slot->details->content_view != NULL - && NAUTILUS_IS_FILES_VIEW (slot->details->content_view)) { - - /* No need to tell the new view - either it is the - * same as the old view, in which case it will already - * be told, or it is the very pending change we wish - * to cancel. - */ - selection = nautilus_view_get_selection (slot->details->content_view); - load_new_location (slot, - location, - selection, - TRUE, - FALSE); - nautilus_file_list_free (selection); - } - - end_location_change (slot); - - if (slot->details->new_content_view) { - g_object_unref (slot->details->new_content_view); - slot->details->new_content_view = NULL; - } -} - void nautilus_window_slot_set_content_view (NautilusWindowSlot *slot, const char *id) @@ -2545,7 +2501,44 @@ nautilus_window_slot_set_allow_stop (NautilusWindowSlot *slot, void nautilus_window_slot_stop_loading (NautilusWindowSlot *slot) { - cancel_location_change (slot); + GList *selection; + GFile *location; + NautilusDirectory *directory; + + location = nautilus_window_slot_get_location (slot); + + directory = nautilus_directory_get (slot->details->location); + + if (NAUTILUS_IS_FILES_VIEW (slot->details->content_view)) { + nautilus_files_view_stop_loading (NAUTILUS_FILES_VIEW (slot->details->content_view)); + } + + nautilus_directory_unref (directory); + + if (slot->details->pending_location != NULL && + location != NULL && + slot->details->content_view != NULL && + NAUTILUS_IS_FILES_VIEW (slot->details->content_view)) { + /* No need to tell the new view - either it is the + * same as the old view, in which case it will already + * be told, or it is the very pending change we wish + * to cancel. + */ + selection = nautilus_view_get_selection (slot->details->content_view); + load_new_location (slot, + location, + selection, + TRUE, + FALSE); + nautilus_file_list_free (selection); + } + + end_location_change (slot); + + if (slot->details->new_content_view) { + g_object_unref (slot->details->new_content_view); + slot->details->new_content_view = NULL; + } } NautilusView* |