Commit 4621e48a authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Default dnd of desktop icons to move. (#504824) Based on patch by Cosimo

2007-12-27  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-dnd.c:
        (nautilus_drag_default_drop_action_for_icons):
	Default dnd of desktop icons to move. (#504824)
	Based on patch by Cosimo Cecchi


svn path=/trunk/; revision=13551
parent 2d3eb33d
2007-12-27 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-dnd.c:
(nautilus_drag_default_drop_action_for_icons):
Default dnd of desktop icons to move. (#504824)
Based on patch by Cosimo Cecchi
2007-12-20 Alexander Larsson <alexl@redhat.com>
* configure.in:
......
......@@ -347,6 +347,7 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context,
{
gboolean same_fs;
gboolean target_is_source_parent;
const char *dropped_uri;
GFile *target, *dropped;
GdkDragAction actions;
......@@ -368,6 +369,8 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context,
return;
}
dropped_uri = ((NautilusDragSelectionItem *)items->data)->uri;
/*
* Check for trash URI. We do a find_directory for any Trash directory.
* Passing 0 permissions as gnome-vfs would override the permissions
......@@ -381,23 +384,30 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context,
return;
} else if (g_str_has_prefix (target_uri_string, NAUTILUS_COMMAND_SPECIFIER)
|| g_str_has_prefix (target_uri_string, NAUTILUS_DESKTOP_COMMAND_SPECIFIER)) {
} else if (g_str_has_prefix (target_uri_string, NAUTILUS_COMMAND_SPECIFIER) ||
g_str_has_prefix (target_uri_string, NAUTILUS_DESKTOP_COMMAND_SPECIFIER) ) {
if (actions & GDK_ACTION_MOVE) {
*action = GDK_ACTION_MOVE;
}
return;
} else if (eel_uri_is_desktop (target_uri_string)) {
target = nautilus_get_desktop_location ();
if (eel_uri_is_desktop (dropped_uri)) {
/* Only move to Desktop icons */
if (actions & GDK_ACTION_MOVE) {
*action = GDK_ACTION_MOVE;
}
return;
}
} else {
target = g_file_new_for_uri (target_uri_string);
}
/* Compare the first dropped uri with the target uri for same fs match. */
dropped = g_file_new_for_uri (((NautilusDragSelectionItem *)items->data)->uri);
dropped = g_file_new_for_uri (dropped_uri);
same_fs = check_same_fs (target, dropped);
target_is_source_parent = FALSE;
target_is_source_parent = g_file_contains_file (target, dropped);
target_is_source_parent = g_file_contains_file (target, dropped);
if (same_fs || target_is_source_parent) {
if (actions & GDK_ACTION_MOVE) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment