From c3341227ea4fd2e248031bb5f2650a38d128a238 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Wed, 3 Dec 2008 14:43:23 +0000 Subject: [PATCH] If the source volume is read only, only allow a copy op since move makes no sense in this case. Ideally we should probably also modify NavMenu and the drag context menu to only present the options that make sense in a particular situation. Fixes ticket #3195. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28769 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/FSUtils.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp index 995b13ee43..eb42defd5b 100644 --- a/src/kits/tracker/FSUtils.cpp +++ b/src/kits/tracker/FSUtils.cpp @@ -658,7 +658,7 @@ MoveTask(BObjectList *srcList, BEntry *destEntry, BList *pointList, u dev_t destVolumeDevice = srcVolumeDevice; StatStruct deststat; - BVolume volume; + BVolume volume (srcVolumeDevice); entry_ref destRef; const entry_ref *destRefToCheck = NULL; @@ -666,7 +666,9 @@ MoveTask(BObjectList *srcList, BEntry *destEntry, BList *pointList, u BDirectory destDir; BDirectory *destDirToCheck = NULL; bool needPreflightNameCheck = false; - + bool sourceIsReadOnly = volume.IsReadOnly(); + volume.Unset(); + bool fromUndo = FSIsUndoMoveMode(moveMode); moveMode = FSMoveMode(moveMode); @@ -705,6 +707,9 @@ MoveTask(BObjectList *srcList, BEntry *destEntry, BList *pointList, u if (moveMode == kCopySelectionTo && destIsTrash) // cannot copy to trash moveMode = kMoveSelectionTo; + + if (moveMode == kMoveSelectionTo && sourceIsReadOnly) + moveMode = kCopySelectionTo; // we need the undo object later on, so we create it no matter // if we really need it or not (it's very lightweight)