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
This commit is contained in:
Rene Gollent 2008-12-03 14:43:23 +00:00
parent f836b0656b
commit c3341227ea

View File

@ -658,7 +658,7 @@ MoveTask(BObjectList<entry_ref> *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<entry_ref> *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<entry_ref> *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)