[nautilus] Revert "files-view: don't open folder with timer for drag&drop"
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Revert "files-view: don't open folder with timer for drag&drop"
- Date: Wed, 2 Sep 2015 13:09:03 +0000 (UTC)
commit 9b487e890e82419c3b210394bce7d83859864043
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Sep 2 14:22:10 2015 +0200
Revert "files-view: don't open folder with timer for drag&drop"
This reverts commit ec2b9674b0025bcd8cd30246135962d5a77d9685.
https://bugzilla.gnome.org/show_bug.cgi?id=754454
src/nautilus-canvas-view.c | 10 ++++++++++
src/nautilus-files-view-dnd.c | 25 +++++++++++++++++++++++++
src/nautilus-files-view-dnd.h | 2 ++
src/nautilus-list-view.c | 10 ++++++++++
4 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 49e5f26..870cb4a 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -1765,6 +1765,14 @@ canvas_view_handle_raw (NautilusCanvasContainer *container, const char *raw_data
raw_data, length, target_uri, direct_save_uri, action, x, y);
}
+static void
+canvas_view_handle_hover (NautilusCanvasContainer *container,
+ const char *target_uri,
+ NautilusCanvasView *view)
+{
+ nautilus_files_view_handle_hover (NAUTILUS_FILES_VIEW (view), target_uri);
+}
+
static char *
canvas_view_get_first_visible_file (NautilusFilesView *view)
{
@@ -1990,6 +1998,8 @@ nautilus_canvas_view_init (NautilusCanvasView *canvas_view)
G_CALLBACK (canvas_view_handle_text), canvas_view, 0);
g_signal_connect_object (canvas_container, "handle-raw",
G_CALLBACK (canvas_view_handle_raw), canvas_view, 0);
+ g_signal_connect_object (canvas_container, "handle-hover",
+ G_CALLBACK (canvas_view_handle_hover), canvas_view, 0);
canvas_view->details->clipboard_handler_id =
g_signal_connect (nautilus_clipboard_monitor_get (),
diff --git a/src/nautilus-files-view-dnd.c b/src/nautilus-files-view-dnd.c
index 14d82b5..6ce84be 100644
--- a/src/nautilus-files-view-dnd.c
+++ b/src/nautilus-files-view-dnd.c
@@ -523,3 +523,28 @@ nautilus_files_view_drop_proxy_received_uris (NautilusFilesView *view,
g_free (container_uri);
}
+
+void
+nautilus_files_view_handle_hover (NautilusFilesView *view,
+ const char *target_uri)
+{
+ NautilusWindowSlot *slot;
+ GFile *location;
+ GFile *current_location;
+ NautilusFile *target_file;
+ gboolean target_is_dir;
+
+ slot = nautilus_files_view_get_nautilus_window_slot (view);
+
+ location = g_file_new_for_uri (target_uri);
+ target_file = nautilus_file_get_existing (location);
+ target_is_dir = nautilus_file_get_file_type (target_file) == G_FILE_TYPE_DIRECTORY;
+ current_location = nautilus_window_slot_get_location (slot);
+ if (target_is_dir && ! (current_location != NULL && g_file_equal(location, current_location))) {
+ nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()),
+ location,
NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE,
+ NULL, NULL, slot);
+ }
+ g_object_unref (location);
+ nautilus_file_unref (target_file);
+}
diff --git a/src/nautilus-files-view-dnd.h b/src/nautilus-files-view-dnd.h
index f7e7bdc..1f12358 100644
--- a/src/nautilus-files-view-dnd.h
+++ b/src/nautilus-files-view-dnd.h
@@ -56,6 +56,8 @@ void nautilus_files_view_handle_raw_drop (NautilusFilesView *view,
GdkDragAction action,
int x,
int y);
+void nautilus_files_view_handle_hover (NautilusFilesView *view,
+ const char *target_uri);
void nautilus_files_view_drop_proxy_received_uris (NautilusFilesView *view,
const GList *uris,
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 6a3c5a0..8ee7769 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -1295,6 +1295,14 @@ list_view_handle_raw (NautilusTreeViewDragDest *dest, const char *raw_data,
}
static void
+list_view_handle_hover (NautilusTreeViewDragDest *dest,
+ const char *target_uri,
+ NautilusListView *view)
+{
+ nautilus_files_view_handle_hover (NAUTILUS_FILES_VIEW (view), target_uri);
+}
+
+static void
move_copy_items_callback (NautilusTreeViewDragDest *dest,
const GList *item_uris,
const char *target_uri,
@@ -1826,6 +1834,8 @@ create_and_set_up_tree_view (NautilusListView *view)
G_CALLBACK (list_view_handle_text), view, 0);
g_signal_connect_object (view->details->drag_dest, "handle-raw",
G_CALLBACK (list_view_handle_raw), view, 0);
+ g_signal_connect_object (view->details->drag_dest, "handle-hover",
+ G_CALLBACK (list_view_handle_hover), view, 0);
g_signal_connect_object (gtk_tree_view_get_selection (view->details->tree_view),
"changed",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]