[nautilus] window-slot: move cancel_location to stop_loading



commit 45db87034e65afe7470d0a2a8ae885b5d20196a4
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Jan 13 20:34:09 2016 +0100

    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

 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 6519ebe..efa9495 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -759,7 +759,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,
@@ -1558,49 +1557,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)
@@ -2535,7 +2491,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*


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