diff options
Diffstat (limited to 'vfs/UVFSCore.pas')
| -rw-r--r-- | vfs/UVFSCore.pas | 216 |
1 files changed, 117 insertions, 99 deletions
diff --git a/vfs/UVFSCore.pas b/vfs/UVFSCore.pas index e7d63a2..5bf185e 100644 --- a/vfs/UVFSCore.pas +++ b/vfs/UVFSCore.pas @@ -136,8 +136,8 @@ type function GetBlockSize: guint32; override; procedure SetBlockSize(Value: guint32); override; - function CopyFileIn(const SourceFile, DestFile: string; Append: boolean; ProgressFunc: TEngineProgressFunc; Sender: Pointer): boolean; override; - function CopyFileOut(const SourceFile, DestFile: string; Append: boolean; ProgressFunc: TEngineProgressFunc; Sender: Pointer): boolean; override; + function CopyFileIn(const SourceFile, DestFile: string; Append: boolean; ProgressFunc: TEngineProgressFunc; Sender: Pointer; Error: PPGError): boolean; override; + function CopyFileOut(const SourceFile, DestFile: string; Append: boolean; ProgressFunc: TEngineProgressFunc; Sender: Pointer; Error: PPGError): boolean; override; function IsOnSameFS(const Path1, Path2: string; FollowSymlinks: boolean): boolean; override; function TwoSameFiles(const Path1, Path2: string; FollowSymlinks: boolean): boolean; override; @@ -161,8 +161,8 @@ type // callbacks here are used for next volume prompts, password prompts (encrypted archives) function StartCopyOperation(AskQuestionCallback: PVFSAskQuestionCallback; AskPasswordCallback: PVFSAskPasswordCallback; ProgressCallback: PVFSProgressCallback; CallbackData: Pointer): boolean; function StopCopyOperation(ProgressCallback: PVFSProgressCallback; CallbackData: Pointer): boolean; - function CopyFileOutEx(const SourceFile, DestFile: string; Append: boolean): boolean; - function CopyFileInEx(const SourceFile, DestFile: string; Append: boolean): boolean; + function CopyFileOutEx(const SourceFile, DestFile: string; Append: boolean; Error: PPGError): boolean; + function CopyFileInEx(const SourceFile, DestFile: string; Append: boolean; Error: PPGError): boolean; published property PluginID: string read GetPluginID; property ArchiveMode: boolean read FArchiveMode; @@ -394,7 +394,7 @@ begin end; except on E: Exception do begin - g_set_error_from_exception(Error, E); + tuxcmd_set_error_from_exception(Error, E); Result := False; end; end; @@ -416,7 +416,7 @@ begin end; except on E: Exception do begin - g_set_error_from_exception(Error, E); + tuxcmd_set_error_from_exception(Error, E); Result := False; end; end; @@ -465,17 +465,16 @@ end; function TVFSEngine.GetListing(List: TList; const APath: string; AddDotFiles, FollowSymlinks, AddFullPath: boolean; Error: PPGError): boolean; var P: PVFSItem; Item: PDataItem; - FError: PGError; begin DebugMsg(['^^VFS (II): GetListing begin']); Result := False; try if (@FSourcePlugin.FVFSListFirst = nil) or (@FSourcePlugin.FVFSListNext = nil) or (@FSourcePlugin.FVFSListClose = nil) then begin - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'File listing not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'File listing not supported by the VFS module.'); Exit; end; - FError := nil; - P := FSourcePlugin.FVFSListFirst(FGlobs, PChar(APath), FollowSymlinks, AddFullPath, @FError); + P := FSourcePlugin.FVFSListFirst(FGlobs, PChar(APath), FollowSymlinks, AddFullPath, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_OPENDIR); while (P <> nil) and (BreakProcessingType <> 2) do begin if (strlen(P^.FName) > 0) and (AddDotFiles or (P^.FName[0] <> '.')) then begin Item := GetDataItemFromVFSItem(P); @@ -485,25 +484,24 @@ begin if P^.FDisplayName <> nil then real_libc_free(P^.FDisplayName); if P^.sLinkTo <> nil then real_libc_free(P^.sLinkTo); real_libc_free(P); - P := FSourcePlugin.FVFSListNext(FGlobs, @FError); + P := FSourcePlugin.FVFSListNext(FGlobs, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_OPENDIR); end; - Result := FError = nil; + Result := Error^ = nil; if BreakProcessingType <> 0 then begin DebugMsg(['^^VFS (WW): GetListing: stopped by BreakProcessing']); - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_CANCELLED), '%s', 'The operation has been cancelled.'); + if Error^ <> nil then + g_error_free(Error^); + Error^ := nil; + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_CANCELLED), '%s', 'The operation has been cancelled.'); Result := False; - end else begin - if (Error <> nil) and (FError <> nil) then - Error^ := g_error_copy(FError); end; - if FError <> nil then - g_error_free(FError); real_libc_free(P); FSourcePlugin.FVFSListClose(FGlobs, nil); except on E: Exception do begin + tuxcmd_set_error_from_exception(Error, E); DebugMsg(['^^VFS (EE): GetListing: Exception: ', E.Message]); - g_set_error_from_exception(Error, E); Result := False; end; end; @@ -518,11 +516,12 @@ begin Result := nil; if @FSourcePlugin.FVFSFileInfo = nil then begin - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Querying file info is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Querying file info is not supported by the VFS module.'); Exit; end; try P := FSourcePlugin.FVFSFileInfo(FGlobs, PChar(APath), FollowSymlinks, AddFullPath, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_STAT); if P <> nil then begin Result := GetDataItemFromVFSItem(P); if P^.FName <> nil then real_libc_free(P^.FName); @@ -533,7 +532,7 @@ begin except on E: Exception do begin DebugMsg(['^^VFS (EE): GetFileInfo: Exception: ', E.Message]); - g_set_error_from_exception(Error, E); + tuxcmd_set_error_from_exception(Error, E); Result := nil; end; end; @@ -606,10 +605,11 @@ begin Result := False; try Result := FSourcePlugin.FVFSChangeDir(FGlobs, PChar(NewPath), Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_CHDIR); except on E: Exception do begin DebugMsg(['^^VFS (EE): ChangeDir: Exception: ', E.Message]); - g_set_error_from_exception(Error, E); + tuxcmd_set_error_from_exception(Error, E); Result := False; end; end; @@ -623,13 +623,14 @@ begin if @FSourcePlugin.FVFSSetCallbacks <> nil then FSourcePlugin.FVFSSetCallbacks(FGlobs, AskQuestionCallback, AskPasswordCallback, ProgressCallback, CallbackData); Result := ChangeDir(NewPath, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_CHDIR); if @FSourcePlugin.FVFSSetCallbacks <> nil then FSourcePlugin.FVFSSetCallbacks(FGlobs, nil, nil, nil, nil); end; except on E: Exception do begin DebugMsg(['^^VFS (EE): ChangeDirEx: Exception: ', E.Message]); - g_set_error_from_exception(Error, E); + tuxcmd_set_error_from_exception(Error, E); Result := False; end; end; @@ -674,71 +675,78 @@ end; function TVFSEngine.MakeDir(const NewDir: string; Error: PPGError): boolean; begin - if @FSourcePlugin.FVFSMkDir <> nil then - Result := FSourcePlugin.FVFSMkDir(FGlobs, PChar(NewDir), Error) - else begin + if @FSourcePlugin.FVFSMkDir <> nil then begin + Result := FSourcePlugin.FVFSMkDir(FGlobs, PChar(NewDir), Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_MKDIR); + end else begin Result := False; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Creating directories is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Creating directories is not supported by the VFS module.'); end; end; function TVFSEngine.Remove(const APath: string; Error: PPGError): boolean; begin - if @FSourcePlugin.FVFSRemove <> nil then - Result := FSourcePlugin.FVFSRemove(FGlobs, PChar(APath), Error) - else begin + if @FSourcePlugin.FVFSRemove <> nil then begin + Result := FSourcePlugin.FVFSRemove(FGlobs, PChar(APath), Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_REMOVE); + end else begin Result := False; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Removing files is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Removing files is not supported by the VFS module.'); end; end; function TVFSEngine.RenameFile(const SourceFile, DestFile: string; Error: PPGError): boolean; begin - if @FSourcePlugin.FVFSRename <> nil then - Result := FSourcePlugin.FVFSRename(FGlobs, PChar(SourceFile), PChar(DestFile), Error) - else begin + if @FSourcePlugin.FVFSRename <> nil then begin + Result := FSourcePlugin.FVFSRename(FGlobs, PChar(SourceFile), PChar(DestFile), Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_RENAME); + end else begin Result := False; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Renaming files is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Renaming files is not supported by the VFS module.'); end; end; function TVFSEngine.MakeSymLink(const NewFileName, PointTo: string; Error: PPGError): boolean; begin - if @FSourcePlugin.FVFSMakeSymLink <> nil then - Result := FSourcePlugin.FVFSMakeSymLink(FGlobs, PChar(NewFileName), PChar(PointTo), Error) - else begin + if @FSourcePlugin.FVFSMakeSymLink <> nil then begin + Result := FSourcePlugin.FVFSMakeSymLink(FGlobs, PChar(NewFileName), PChar(PointTo), Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_SYMLINK); + end else begin Result := False; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Creating symbolic links is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Creating symbolic links is not supported by the VFS module.'); end; end; function TVFSEngine.Chmod(const FileName: string; Mode: cuLong; Error: PPGError): boolean; begin - if @FSourcePlugin.FVFSChmod <> nil then - Result := FSourcePlugin.FVFSChmod(FGlobs, PChar(FileName), Mode, Error) - else begin + if @FSourcePlugin.FVFSChmod <> nil then begin + Result := FSourcePlugin.FVFSChmod(FGlobs, PChar(FileName), Mode, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_CHMOD); + end else begin Result := False; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Chmod is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Chmod is not supported by the VFS module.'); end; end; function TVFSEngine.Chown(const FileName: string; UID, GID: cuLong; Error: PPGError): boolean; begin - if @FSourcePlugin.FVFSChown <> nil then - Result := FSourcePlugin.FVFSChown(FGlobs, PChar(FileName), UID, GID, Error) - else begin + if @FSourcePlugin.FVFSChown <> nil then begin + Result := FSourcePlugin.FVFSChown(FGlobs, PChar(FileName), UID, GID, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_CHOWN); + end else begin Result := False; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Chown is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Chown is not supported by the VFS module.'); end; end; function TVFSEngine.ChangeTimes(const APath: string; mtime, atime: time_t; Error: PPGError): boolean; begin - if @FSourcePlugin.FVFSChangeTimes <> nil then - Result := FSourcePlugin.FVFSChangeTimes(FGlobs, PChar(APath), mtime, atime, Error) - else begin + if @FSourcePlugin.FVFSChangeTimes <> nil then begin + Result := FSourcePlugin.FVFSChangeTimes(FGlobs, PChar(APath), mtime, atime, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_TIMESTAMPS); + end else begin Result := False; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Changing timestamps is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Changing timestamps is not supported by the VFS module.'); end; end; @@ -778,48 +786,56 @@ end; function TVFSEngine.OpenFile(const APath: string; Mode: integer; Error: PPGError): TEngineFileDes; begin - if @FSourcePlugin.FVFSOpenFile <> nil then - Result := FSourcePlugin.FVFSOpenFile(FGlobs, PChar(APath), Mode, Error) - else begin + if @FSourcePlugin.FVFSOpenFile <> nil then begin + Result := FSourcePlugin.FVFSOpenFile(FGlobs, PChar(APath), Mode, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_OPEN_FILE); + end else begin Result := nil; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Manual opening files is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Manual opening files is not supported by the VFS module.'); end; end; function TVFSEngine.ReadFile(const FileDescriptor: TEngineFileDes; Buffer: Pointer; ABlockSize: integer; Error: PPGError): integer; begin - if @FSourcePlugin.FVFSReadFile <> nil then - Result := FSourcePlugin.FVFSReadFile(FGlobs, FileDescriptor, Buffer, ABlockSize, Error) - else begin + if @FSourcePlugin.FVFSReadFile <> nil then begin + Result := FSourcePlugin.FVFSReadFile(FGlobs, FileDescriptor, Buffer, ABlockSize, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_READ_FILE); + end else begin Result := -1; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Manual read is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Manual read is not supported by the VFS module.'); end; end; function TVFSEngine.WriteFile(const FileDescriptor: TEngineFileDes; Buffer: Pointer; BytesCount: integer; Error: PPGError): integer; begin - if @FSourcePlugin.FVFSWriteFile <> nil then - Result := FSourcePlugin.FVFSWriteFile(FGlobs, FileDescriptor, Buffer, BytesCount, Error) - else begin + if @FSourcePlugin.FVFSWriteFile <> nil then begin + Result := FSourcePlugin.FVFSWriteFile(FGlobs, FileDescriptor, Buffer, BytesCount, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_WRITE_FILE); + end else begin Result := -1; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Manual write is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Manual write is not supported by the VFS module.'); end; end; function TVFSEngine.CloseFile(const FileDescriptor: TEngineFileDes; Error: PPGError): boolean; begin - if @FSourcePlugin.FVFSCloseFile <> nil then - Result := FSourcePlugin.FVFSCloseFile(FGlobs, FileDescriptor, nil) - else Result := False; + if @FSourcePlugin.FVFSCloseFile <> nil then begin + Result := FSourcePlugin.FVFSCloseFile(FGlobs, FileDescriptor, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_CLOSE_FILE); + end else begin + Result := False; + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Manual closing files is not supported by the VFS module.'); + end; end; function TVFSEngine.FileSeek(const FileDescriptor: TEngineFileDes; const AbsoluteOffset: Int64; Error: PPGError): Int64; begin - if @FSourcePlugin.FVFSFileSeek <> nil then - Result := FSourcePlugin.FVFSFileSeek(FGlobs, FileDescriptor, AbsoluteOffset, Error) - else begin + if @FSourcePlugin.FVFSFileSeek <> nil then begin + Result := FSourcePlugin.FVFSFileSeek(FGlobs, FileDescriptor, AbsoluteOffset, Error); + VFSToTuxcmdError(Error, TUXCMD_ERROR_SEEK); + end else begin Result := -1; - g_set_error(Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'Manual seek is not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'Manual seek is not supported by the VFS module.'); end; end; @@ -832,73 +848,75 @@ end; (********************************************************************************************************************************) -function TVFSEngine.CopyFileIn(const SourceFile, DestFile: string; Append: boolean; ProgressFunc: TEngineProgressFunc; Sender: Pointer): boolean; +function TVFSEngine.CopyFileIn(const SourceFile, DestFile: string; Append: boolean; ProgressFunc: TEngineProgressFunc; Sender: Pointer; Error: PPGError): boolean; begin DebugMsg(['** (WW): deprecated method CopyFileIn called from a TVFSEngine instance!']); Result := StartCopyOperation(nil, nil, nil, nil); - Result := Result and CopyFileInEx(SourceFile, DestFile, Append); + Result := Result and CopyFileInEx(SourceFile, DestFile, Append, Error); Result := Result and StopCopyOperation(nil, nil); end; -function TVFSEngine.CopyFileOut(const SourceFile, DestFile: string; Append: boolean; ProgressFunc: TEngineProgressFunc; Sender: Pointer): boolean; +function TVFSEngine.CopyFileOut(const SourceFile, DestFile: string; Append: boolean; ProgressFunc: TEngineProgressFunc; Sender: Pointer; Error: PPGError): boolean; begin DebugMsg(['** (WW): deprecated method CopyFileOut called from a TVFSEngine instance!']); Result := StartCopyOperation(nil, nil, nil, nil); - Result := Result and CopyFileOutEx(SourceFile, DestFile, Append); + Result := Result and CopyFileOutEx(SourceFile, DestFile, Append, Error); Result := Result and StopCopyOperation(nil, nil); end; -function TVFSEngine.CopyFileOutEx(const SourceFile, DestFile: string; Append: boolean): boolean; -var Error: PGError; - ACopyProgressCallback: TVFSProgressCallback; +function TVFSEngine.CopyFileOutEx(const SourceFile, DestFile: string; Append: boolean; Error: PPGError): boolean; +var ACopyProgressCallback: TVFSProgressCallback; begin Result := False; try - Error := nil; if @FSourcePlugin.FVFSCopyToLocal <> nil then try - Result := FSourcePlugin.FVFSCopyToLocal(FGlobs, PChar(SourceFile), PChar(DestFile), Append, @Error) + Result := FSourcePlugin.FVFSCopyToLocal(FGlobs, PChar(SourceFile), PChar(DestFile), Append, Error) except - on E: Exception do g_set_error_from_exception(@Error, E); + on E: Exception do tuxcmd_set_error_from_exception(Error, E); end else - g_set_error(@Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'VFSCopyToLocal not supported by the VFS module.'); - if Error <> nil then begin + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'VFSCopyToLocal not supported by the VFS module.'); + if Error^ <> nil then begin if FCopyProgressCallback <> nil then begin @ACopyProgressCallback := FCopyProgressCallback; - Result := ACopyProgressCallback(0, Error, FCopyCallbackData); + Result := ACopyProgressCallback(0, Error^, FCopyCallbackData); end; - g_error_free(Error); end; except - on E: Exception do DebugMsg(['*** Exception raised in TVFSEngine.CopyFileOutEx(SourceFile=', SourceFile, ', DestFile=', DestFile, ', Append=', Append,'): (', E.ClassName, '): ', E.Message]); + on E: Exception do begin + Result := False; + tuxcmd_set_error_from_exception(Error, E); + DebugMsg(['*** Exception raised in TVFSEngine.CopyFileOutEx(SourceFile=', SourceFile, ', DestFile=', DestFile, ', Append=', Append,'): (', E.ClassName, '): ', E.Message]); + end; end; end; -function TVFSEngine.CopyFileInEx(const SourceFile, DestFile: string; Append: boolean): boolean; -var Error: PGError; -ACopyProgressCallback: TVFSProgressCallback; +function TVFSEngine.CopyFileInEx(const SourceFile, DestFile: string; Append: boolean; Error: PPGError): boolean; +var ACopyProgressCallback: TVFSProgressCallback; begin Result := False; try - Error := nil; if @FSourcePlugin.FVFSCopyFromLocal <> nil then try - Result := FSourcePlugin.FVFSCopyFromLocal(FGlobs, PChar(SourceFile), PChar(DestFile), Append, @Error) + Result := FSourcePlugin.FVFSCopyFromLocal(FGlobs, PChar(SourceFile), PChar(DestFile), Append, Error) except - on E: Exception do g_set_error_from_exception(@Error, E); + on E: Exception do tuxcmd_set_error_from_exception(Error, E); end else - g_set_error(@Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'VFSCopyFromLocal not supported by the VFS module.'); + g_set_error(Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'VFSCopyFromLocal not supported by the VFS module.'); if Error <> nil then begin if FCopyProgressCallback <> nil then begin @ACopyProgressCallback := FCopyProgressCallback; - Result := ACopyProgressCallback(0, Error, FCopyCallbackData); + Result := ACopyProgressCallback(0, Error^, FCopyCallbackData); end; - g_error_free(Error); end; except - on E: Exception do DebugMsg(['*** Exception raised in TVFSEngine.CopyFileInEx(SourceFile=', SourceFile, ', DestFile=', DestFile, ', Append=', Append,'): (', E.ClassName, '): ', E.Message]); + on E: Exception do begin + Result := False; + tuxcmd_set_error_from_exception(Error, E); + DebugMsg(['*** Exception raised in TVFSEngine.CopyFileInEx(SourceFile=', SourceFile, ', DestFile=', DestFile, ', Append=', Append,'): (', E.ClassName, '): ', E.Message]); + end; end; end; @@ -917,10 +935,10 @@ begin try Result := FSourcePlugin.FVFSStartCopyOperation(FGlobs, @Error) except - on E: Exception do g_set_error_from_exception(@Error, E); + on E: Exception do tuxcmd_set_error_from_exception(@Error, E); end else - g_set_error(@Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'VFSStartCopyOperation not supported by the VFS module.'); + g_set_error(@Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'VFSStartCopyOperation not supported by the VFS module.'); if Error <> nil then begin if ProgressCallback <> nil then Result := ProgressCallback^(0, Error, CallbackData); @@ -945,10 +963,10 @@ begin try Result := FSourcePlugin.FVFSStopCopyOperation(FGlobs, @Error) except - on E: Exception do g_set_error_from_exception(@Error, E); + on E: Exception do tuxcmd_set_error_from_exception(@Error, E); end else - g_set_error(@Error, G_IO_ERROR, gint(G_IO_ERROR_NOT_SUPPORTED), '%s', 'VFSStopCopyOperation not supported by the VFS module.'); + g_set_error(@Error, TUXCMD_ERROR, gint(TUXCMD_ERROR_NOT_SUPPORTED), '%s', 'VFSStopCopyOperation not supported by the VFS module.'); if Error <> nil then begin if ProgressCallback <> nil then Result := ProgressCallback^(0, Error, CallbackData); |
