mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Bug [0001563] File and directory with the same name #3
This commit is contained in:
parent
c0062108d1
commit
f83b3f035b
1 changed files with 51 additions and 50 deletions
|
|
@ -1260,67 +1260,68 @@ var
|
|||
end;
|
||||
|
||||
begin
|
||||
case FDirExistsOption of
|
||||
fsoodeNone:
|
||||
if (FDirExistsOption = fsoodeNone) or
|
||||
((FDirExistsOption = fsoodeDelete) and (AllowDelete = False)) or
|
||||
((FDirExistsOption = fsoodeCopyInto) and (AllowCopyInto = False)) then
|
||||
begin
|
||||
if AllowDelete then
|
||||
AddResponse(fsourOverwrite);
|
||||
if AllowCopyInto then
|
||||
begin
|
||||
if AllowDelete then
|
||||
AddResponse(fsourOverwrite);
|
||||
if AllowCopyInto then
|
||||
begin
|
||||
AddResponse(fsourCopyInto);
|
||||
AddResponse(fsourCopyIntoAll);
|
||||
end;
|
||||
AddResponse(fsourSkip);
|
||||
if AllowDelete then
|
||||
AddResponse(fsourOverwriteAll);
|
||||
AddResponse(fsourSkipAll);
|
||||
AddResponse(fsourCancel);
|
||||
|
||||
if AllowCopyInto then
|
||||
DefaultOkResponse := fsourCopyInto
|
||||
else if AllowDelete then
|
||||
DefaultOkResponse := fsourOverwrite
|
||||
else
|
||||
DefaultOkResponse := fsourSkip;
|
||||
|
||||
if AllowCopyInto or AllowDelete then
|
||||
Message:= Format(rsMsgFolderExistsRwrt, [AbsoluteTargetFileName])
|
||||
else begin
|
||||
Message:= Format(rsMsgCannotOverwriteDirectory, [AbsoluteTargetFileName, aFile.FullPath]);
|
||||
end;
|
||||
|
||||
case AskQuestion(Message, '',
|
||||
PossibleResponses, DefaultOkResponse, fsourSkip) of
|
||||
fsourOverwrite:
|
||||
Result := fsoodeDelete;
|
||||
fsourCopyInto:
|
||||
Result := fsoodeCopyInto;
|
||||
fsourCopyIntoAll:
|
||||
begin
|
||||
FDirExistsOption := fsoodeCopyInto;
|
||||
Result := fsoodeCopyInto;
|
||||
end;
|
||||
fsourSkip:
|
||||
Result := fsoodeSkip;
|
||||
fsourOverwriteAll:
|
||||
begin
|
||||
FDirExistsOption := fsoodeDelete;
|
||||
Result := fsoodeDelete;
|
||||
end;
|
||||
fsourSkipAll:
|
||||
begin
|
||||
FDirExistsOption := fsoodeSkip;
|
||||
Result := fsoodeSkip;
|
||||
end;
|
||||
fsourNone,
|
||||
fsourCancel:
|
||||
AbortOperation;
|
||||
end;
|
||||
AddResponse(fsourCopyInto);
|
||||
AddResponse(fsourCopyIntoAll);
|
||||
end;
|
||||
AddResponse(fsourSkip);
|
||||
if AllowDelete then
|
||||
AddResponse(fsourOverwriteAll);
|
||||
if AllowCopyInto or AllowDelete then
|
||||
AddResponse(fsourSkipAll);
|
||||
AddResponse(fsourCancel);
|
||||
|
||||
if AllowCopyInto then
|
||||
DefaultOkResponse := fsourCopyInto
|
||||
else if AllowDelete then
|
||||
DefaultOkResponse := fsourOverwrite
|
||||
else
|
||||
DefaultOkResponse := fsourSkip;
|
||||
|
||||
if AllowCopyInto or AllowDelete then
|
||||
Message:= Format(rsMsgFolderExistsRwrt, [AbsoluteTargetFileName])
|
||||
else begin
|
||||
Message:= Format(rsMsgCannotOverwriteDirectory, [AbsoluteTargetFileName, aFile.FullPath]);
|
||||
end;
|
||||
|
||||
case AskQuestion(Message, '',
|
||||
PossibleResponses, DefaultOkResponse, fsourSkip) of
|
||||
fsourOverwrite:
|
||||
Result := fsoodeDelete;
|
||||
fsourCopyInto:
|
||||
Result := fsoodeCopyInto;
|
||||
fsourCopyIntoAll:
|
||||
begin
|
||||
FDirExistsOption := fsoodeCopyInto;
|
||||
Result := fsoodeCopyInto;
|
||||
end;
|
||||
fsourSkip:
|
||||
Result := fsoodeSkip;
|
||||
fsourOverwriteAll:
|
||||
begin
|
||||
FDirExistsOption := fsoodeDelete;
|
||||
Result := fsoodeDelete;
|
||||
end;
|
||||
fsourSkipAll:
|
||||
begin
|
||||
FDirExistsOption := fsoodeSkip;
|
||||
Result := fsoodeSkip;
|
||||
end;
|
||||
fsourNone,
|
||||
fsourCancel:
|
||||
AbortOperation;
|
||||
end;
|
||||
end
|
||||
|
||||
else
|
||||
Result := FDirExistsOption;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFileSystemOperationHelper.FileExists(aFile: TFile;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue