[nautilus] dnd: fix dnd issues with Type=Link desktop files
- From: Nelson Benítez León <nbenitez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] dnd: fix dnd issues with Type=Link desktop files
- Date: Wed, 7 Jan 2015 11:10:07 +0000 (UTC)
commit fa1211f8ed069a3a9e994249caa35e041e835030
Author: Nelson Benítez León <nbenitezl+gnome gmail com>
Date: Sat Dec 27 20:24:56 2014 +0500
dnd: fix dnd issues with Type=Link desktop files
When creating NautilusDragSelectionItem items for dnd
make sure we use regular uri (instead of activation uri)
for Type=Link desktop files.
Other types of desktop files were not affected by this bug
as their regular uri and activation uri are usually the same.
Fixes bug 720390
libnautilus-private/nautilus-canvas-dnd.c | 6 +++++-
src/nautilus-list-view.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-canvas-dnd.c b/libnautilus-private/nautilus-canvas-dnd.c
index 3fd46e7..b4da369 100644
--- a/libnautilus-private/nautilus-canvas-dnd.c
+++ b/libnautilus-private/nautilus-canvas-dnd.c
@@ -224,6 +224,7 @@ icon_get_data_binder (NautilusCanvasIcon *icon, gpointer data)
EelIRect widget_rect;
char *uri;
NautilusCanvasContainer *container;
+ NautilusFile *file;
context = (CanvasGetDataBinderContext *)data;
@@ -236,13 +237,15 @@ icon_get_data_binder (NautilusCanvasIcon *icon, gpointer data)
canvas_rect_world_to_widget (EEL_CANVAS (container), &world_rect, &widget_rect);
uri = nautilus_canvas_container_get_icon_uri (container, icon);
- if (!eel_uri_is_desktop (uri)) {
+ file = nautilus_file_get_by_uri (uri);
+ if (!eel_uri_is_desktop (uri) && !nautilus_file_is_nautilus_link (file)) {
g_free (uri);
uri = nautilus_canvas_container_get_icon_activation_uri (container, icon);
}
if (uri == NULL) {
g_warning ("no URI for one of the iterated icons");
+ nautilus_file_unref (file);
return TRUE;
}
@@ -262,6 +265,7 @@ icon_get_data_binder (NautilusCanvasIcon *icon, gpointer data)
context->iteratee_data);
g_free (uri);
+ nautilus_file_unref (file);
return TRUE;
}
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index d1abe48..a7132a6 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -464,7 +464,11 @@ item_get_data_binder (GtkTreeModel *model,
column,
&cell_area);
- uri = nautilus_file_get_activation_uri (file);
+ if (nautilus_file_is_nautilus_link (file)) {
+ uri = nautilus_file_get_uri (file);
+ } else {
+ uri = nautilus_file_get_activation_uri (file);
+ }
nautilus_file_unref (file);
/* pass the uri, mouse-relative x/y and icon width/height */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]