summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-12-22 23:41:20 +0200
committerErnestas Kulik <ernestask@gnome.org>2018-03-24 20:10:35 +0200
commite522bc055ff643964f48d04141e96ff9220c4dc8 (patch)
treed398d51e80b82877da975d9c87ad3c7bb8f3c5ec
parent5cb690e9ba6f3cd32325926f24b537e9690e6aae (diff)
downloadnautilus-e522bc055ff643964f48d04141e96ff9220c4dc8.tar.gz
window-slot-dnd: fix drop condition check
Drag and dropping on a search or starred location tab gives an error dialog that says "Error while copying to /". In order to be able to drop the selection on a target it is also necessary to check whether it is editable, property which is set False for the Star and Search directories. https://gitlab.gnome.org/GNOME/nautilus/issues/168
-rw-r--r--src/nautilus-window-slot-dnd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index b8dd87a07..dede5dc1f 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -220,9 +220,12 @@ slot_proxy_drag_motion (GtkWidget *widget,
if (target_uri != NULL)
{
NautilusFile *file;
+ NautilusDirectory *directory;
gboolean can;
file = nautilus_file_get_existing_by_uri (target_uri);
- can = nautilus_file_can_write (file);
+ directory = nautilus_directory_get_for_file (file);
+ can = nautilus_file_can_write (file) && nautilus_directory_is_editable (directory);
+ nautilus_directory_unref (directory);
g_object_unref (file);
if (!can)
{