From cf1f8d377549c6cb5ad9475dcd5ec5f48738a8e8 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 4 Oct 2009 15:00:25 +0200 Subject: Consolidate plugin IDs This breaks custom-chosen plugins for saved connections (with automatic fallback to 'auto') --- vfs/UVFSCore.pas | 34 +++++++++++++++++----------------- vfs/uVFSprototypes.pas | 10 +++++----- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'vfs') diff --git a/vfs/UVFSCore.pas b/vfs/UVFSCore.pas index 7c85b02..7c98303 100644 --- a/vfs/UVFSCore.pas +++ b/vfs/UVFSCore.pas @@ -76,10 +76,10 @@ type destructor Destroy; override; function VFSVersion: integer; - function VFSName: PChar; - function VFSDescription: PChar; - function VFSAbout: PChar; - function VFSCopyright: PChar; + function ModuleID: string; + function ModuleName: string; + function ModuleAbout: string; + function ModuleCopyright: string; end; @@ -257,40 +257,40 @@ begin else Result := -1; end; -function TVFSPlugin.VFSName: PChar; +function TVFSPlugin.ModuleID: string; var Info: TVFSInfo; begin if @FVFSGetInfo <> nil then begin Info := FVFSGetInfo; - Result := Info.Name; - end else Result := nil; + Result := String(Info.ID); + end else Result := ''; end; -function TVFSPlugin.VFSDescription: PChar; +function TVFSPlugin.ModuleName: string; var Info: TVFSInfo; begin if @FVFSGetInfo <> nil then begin Info := FVFSGetInfo; - Result := Info.Description; - end else Result := nil; + Result := String(Info.Name); + end else Result := ''; end; -function TVFSPlugin.VFSAbout: PChar; +function TVFSPlugin.ModuleAbout: string; var Info: TVFSInfo; begin if @FVFSGetInfo <> nil then begin Info := FVFSGetInfo; - Result := Info.About; - end else Result := nil; + Result := String(Info.About); + end else Result := ''; end; -function TVFSPlugin.VFSCopyright: PChar; +function TVFSPlugin.ModuleCopyright: string; var Info: TVFSInfo; begin if @FVFSGetInfo <> nil then begin Info := FVFSGetInfo; - Result := Info.Copyright; - end else Result := nil; + Result := String(Info.Copyright); + end else Result := ''; end; (********************************************************************************************************************************) @@ -963,7 +963,7 @@ end; (********************************************************************************************************************************) function TVFSEngine.GetPluginID: string; begin - if FSourcePlugin <> nil then Result := FSourcePlugin.VFSName + if FSourcePlugin <> nil then Result := FSourcePlugin.ModuleID else Result := ''; end; diff --git a/vfs/uVFSprototypes.pas b/vfs/uVFSprototypes.pas index 5f0106c..b454769 100644 --- a/vfs/uVFSprototypes.pas +++ b/vfs/uVFSprototypes.pas @@ -144,12 +144,12 @@ type {$ENDIF} end; - // This structure contains basic informations about the plugin (Name is used to identify the module in the application) + // This structure contains basic informations about the plugin TVFSInfo = record - Name: PChar; - Description: PChar; - About: PChar; - Copyright: PChar; + ID: PChar; // unique identifier, not shown in GUI + Name: PChar; // plugin name, GUI string (UTF-8) + About: PChar; // GUI string (UTF-8) + Copyright: PChar; // GUI string (UTF-8) end; type -- cgit v1.2.3