diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2013-03-06 16:00:29 -0500 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2013-03-06 16:00:29 -0500 |
commit | 1d1488cbc96ee9f7dd69b708e093d274a5374878 (patch) | |
tree | 396d56df993e657d18ed4ccb58df2df6b52849be /libnautilus-private | |
parent | 26d023a289c2160147bc02f1e18243f8212c82eb (diff) | |
download | nautilus-1d1488cbc96ee9f7dd69b708e093d274a5374878.tar.gz |
Always use activation URI for DnD sources
This ensures DnD from special locations (e.g. Recent or Trash) always
works even for targets that do not use gvfs.
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-canvas-container.c | 25 | ||||
-rw-r--r-- | libnautilus-private/nautilus-canvas-container.h | 2 | ||||
-rw-r--r-- | libnautilus-private/nautilus-canvas-dnd.c | 2 | ||||
-rw-r--r-- | libnautilus-private/nautilus-canvas-private.h | 2 |
4 files changed, 30 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c index ce3ae9702..145056552 100644 --- a/libnautilus-private/nautilus-canvas-container.c +++ b/libnautilus-private/nautilus-canvas-container.c @@ -226,6 +226,7 @@ enum { MIDDLE_CLICK, GET_CONTAINER_URI, GET_ICON_URI, + GET_ICON_ACTIVATION_URI, GET_ICON_DROP_TARGET_URI, GET_STORED_ICON_POSITION, ICON_POSITION_CHANGED, @@ -4847,6 +4848,16 @@ nautilus_canvas_container_class_init (NautilusCanvasContainerClass *class) g_cclosure_marshal_generic, G_TYPE_STRING, 1, G_TYPE_POINTER); + signals[GET_ICON_ACTIVATION_URI] + = g_signal_new ("get-icon-activation-uri", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusCanvasContainerClass, + get_icon_activation_uri), + NULL, NULL, + g_cclosure_marshal_generic, + G_TYPE_STRING, 1, + G_TYPE_POINTER); signals[GET_ICON_DROP_TARGET_URI] = g_signal_new ("get-icon-drop-target-uri", G_TYPE_FROM_CLASS (class), @@ -6964,6 +6975,20 @@ nautilus_canvas_container_get_icon_uri (NautilusCanvasContainer *container, } char * +nautilus_canvas_container_get_icon_activation_uri (NautilusCanvasContainer *container, + NautilusCanvasIcon *icon) +{ + char *uri; + + uri = NULL; + g_signal_emit (container, + signals[GET_ICON_ACTIVATION_URI], 0, + icon->data, + &uri); + return uri; +} + +char * nautilus_canvas_container_get_icon_drop_target_uri (NautilusCanvasContainer *container, NautilusCanvasIcon *icon) { diff --git a/libnautilus-private/nautilus-canvas-container.h b/libnautilus-private/nautilus-canvas-container.h index d5ec7a09f..ff534a76b 100644 --- a/libnautilus-private/nautilus-canvas-container.h +++ b/libnautilus-private/nautilus-canvas-container.h @@ -180,6 +180,8 @@ typedef struct { NautilusCanvasPosition *position); char * (* get_icon_uri) (NautilusCanvasContainer *container, NautilusCanvasIconData *data); + char * (* get_icon_activation_uri) (NautilusCanvasContainer *container, + NautilusCanvasIconData *data); char * (* get_icon_drop_target_uri) (NautilusCanvasContainer *container, NautilusCanvasIconData *data); diff --git a/libnautilus-private/nautilus-canvas-dnd.c b/libnautilus-private/nautilus-canvas-dnd.c index b4eb5868e..b85d635b3 100644 --- a/libnautilus-private/nautilus-canvas-dnd.c +++ b/libnautilus-private/nautilus-canvas-dnd.c @@ -238,7 +238,7 @@ 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); + uri = nautilus_canvas_container_get_icon_activation_uri (container, icon); if (uri == NULL) { g_warning ("no URI for one of the iterated icons"); return TRUE; diff --git a/libnautilus-private/nautilus-canvas-private.h b/libnautilus-private/nautilus-canvas-private.h index 79154dbaf..3753ad191 100644 --- a/libnautilus-private/nautilus-canvas-private.h +++ b/libnautilus-private/nautilus-canvas-private.h @@ -272,6 +272,8 @@ void nautilus_canvas_container_select_list_unselect_others (NautilusCan GList *icons); char * nautilus_canvas_container_get_icon_uri (NautilusCanvasContainer *container, NautilusCanvasIcon *canvas); +char * nautilus_canvas_container_get_icon_activation_uri (NautilusCanvasContainer *container, + NautilusCanvasIcon *canvas); char * nautilus_canvas_container_get_icon_drop_target_uri (NautilusCanvasContainer *container, NautilusCanvasIcon *canvas); void nautilus_canvas_container_update_icon (NautilusCanvasContainer *container, |