summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-01-13 20:34:09 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-01-14 17:04:30 +0100
commit79a9736f466e552f70b0da30a36d9a83d8585158 (patch)
tree7ef727eaabab1d3f57d86477d81a756c87b006ea
parentc97dc76083c9db2bece1e852048195dd2719a78c (diff)
downloadnautilus-79a9736f466e552f70b0da30a36d9a83d8585158.tar.gz
window-slot: move cancel_location to stop_loading
Since now they are the same, just use the public api.
-rw-r--r--src/nautilus-window-slot.c83
1 files changed, 38 insertions, 45 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 6519ebe9c..efa94954d 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*