summaryrefslogtreecommitdiff
path: root/vfs
diff options
context:
space:
mode:
Diffstat (limited to 'vfs')
-rw-r--r--vfs/UVFSCore.pas60
1 files changed, 32 insertions, 28 deletions
diff --git a/vfs/UVFSCore.pas b/vfs/UVFSCore.pas
index ff5445d..3e14618 100644
--- a/vfs/UVFSCore.pas
+++ b/vfs/UVFSCore.pas
@@ -843,23 +843,25 @@ end;
function TVFSEngine.StartCopyOperation(Sender: Pointer; ErrorFunc: TEngineErrorFunc; AskQuestionCallback: PVFSAskQuestionCallback; AskPasswordCallback: PVFSAskPasswordCallback; ProgressCallback: PVFSProgressCallback; CallbackData: Pointer): boolean;
var Res: TVFSResult;
begin
- Result := False;
+ Result := not ArchiveMode;
try
if @FSourcePlugin.FVFSSetCallbacks <> nil then
FSourcePlugin.FVFSSetCallbacks(FGlobs, AskQuestionCallback, AskPasswordCallback, ProgressCallback, CallbackData);
- if @FSourcePlugin.FVFSStartCopyOperation <> nil then begin
- Res := FSourcePlugin.FVFSStartCopyOperation(FGlobs);
- Result := Res = cVFS_OK;
- // * TODO: Port to GError
- if (Res <> cVFS_OK) and Assigned(ErrorFunc) then
- case Res of
- cVFS_ReadErr: Result := ErrorFunc(Sender, 6, 0, 'StartCopyOperation');
- cVFS_WriteErr: Result := ErrorFunc(Sender, 7, 0, 'StartCopyOperation');
- cVFS_mallocFailed: ErrorFunc(Sender, 1, 0, 'StartCopyOperation');
- cVFS_Cancelled: ErrorFunc(Sender, 0, 0, 'StartCopyOperation');
- end;
- end else
- ErrorFunc(Sender, 2, 0, 'StartCopyOperation not supported');
+ if ArchiveMode then begin
+ if @FSourcePlugin.FVFSStartCopyOperation <> nil then begin
+ Res := FSourcePlugin.FVFSStartCopyOperation(FGlobs);
+ Result := Res = cVFS_OK;
+ // * TODO: Port to GError
+ if (Res <> cVFS_OK) and Assigned(ErrorFunc) then
+ case Res of
+ cVFS_ReadErr: Result := ErrorFunc(Sender, 6, 0, 'StartCopyOperation');
+ cVFS_WriteErr: Result := ErrorFunc(Sender, 7, 0, 'StartCopyOperation');
+ cVFS_mallocFailed: ErrorFunc(Sender, 1, 0, 'StartCopyOperation');
+ cVFS_Cancelled: ErrorFunc(Sender, 0, 0, 'StartCopyOperation');
+ end;
+ end else
+ ErrorFunc(Sender, 2, 0, 'StartCopyOperation not supported');
+ end;
except
on E: Exception do DebugMsg(['*** Exception raised in TVFSEngine.StartCopyOperation(Sender=', QWord(Sender), '): (', E.ClassName, '): ', E.Message]);
end;
@@ -868,23 +870,25 @@ end;
function TVFSEngine.StopCopyOperation(Sender: Pointer; ErrorFunc: TEngineErrorFunc): boolean;
var Res: TVFSResult;
begin
- Result := False;
+ Result := not ArchiveMode;
try
if @FSourcePlugin.FVFSSetCallbacks <> nil then
FSourcePlugin.FVFSSetCallbacks(FGlobs, nil, nil, nil, nil);
- if @FSourcePlugin.FVFSStopCopyOperation <> nil then begin
- Res := FSourcePlugin.FVFSStopCopyOperation(FGlobs);
- Result := Res = cVFS_OK;
- // * TODO: Port to GError
- if (Res <> cVFS_OK) and Assigned(ErrorFunc) then
- case Res of
- cVFS_ReadErr: Result := ErrorFunc(Sender, 6, 0, 'StopCopyOperation');
- cVFS_WriteErr: Result := ErrorFunc(Sender, 7, 0, 'StopCopyOperation');
- cVFS_mallocFailed: ErrorFunc(Sender, 1, 0, 'StopCopyOperation');
- cVFS_Cancelled: ErrorFunc(Sender, 0, 0, 'StopCopyOperation');
- end;
- end else
- ErrorFunc(Sender, 5, 0, 'StopCopyOperation not supported');
+ if ArchiveMode then begin
+ if @FSourcePlugin.FVFSStopCopyOperation <> nil then begin
+ Res := FSourcePlugin.FVFSStopCopyOperation(FGlobs);
+ Result := Res = cVFS_OK;
+ // * TODO: Port to GError
+ if (Res <> cVFS_OK) and Assigned(ErrorFunc) then
+ case Res of
+ cVFS_ReadErr: Result := ErrorFunc(Sender, 6, 0, 'StopCopyOperation');
+ cVFS_WriteErr: Result := ErrorFunc(Sender, 7, 0, 'StopCopyOperation');
+ cVFS_mallocFailed: ErrorFunc(Sender, 1, 0, 'StopCopyOperation');
+ cVFS_Cancelled: ErrorFunc(Sender, 0, 0, 'StopCopyOperation');
+ end;
+ end else
+ ErrorFunc(Sender, 5, 0, 'StopCopyOperation not supported');
+ end;
except
on E: Exception do DebugMsg(['*** Exception raised in TVFSEngine.StopCopyOperation(Sender=', QWord(Sender), '): (', E.ClassName, '): ', E.Message]);
end;