mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Special case for smb:// protocol
This commit is contained in:
parent
43fe842b9d
commit
4f2bae9652
2 changed files with 18 additions and 8 deletions
|
|
@ -344,7 +344,7 @@ type
|
|||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
|
||||
function Find(FileSourceClass: TClass; Address: String): IFileSource;
|
||||
function Find(FileSourceClass: TClass; Address: String; CaseSensitive: Boolean = True): IFileSource;
|
||||
end;
|
||||
|
||||
EFileSourceException = class(Exception);
|
||||
|
|
@ -921,16 +921,23 @@ begin
|
|||
FFileSources.Remove(aFileSource);
|
||||
end;
|
||||
|
||||
function TFileSourceManager.Find(FileSourceClass: TClass; Address: String): IFileSource;
|
||||
function TFileSourceManager.Find(FileSourceClass: TClass; Address: String;
|
||||
CaseSensitive: Boolean): IFileSource;
|
||||
var
|
||||
i: Integer;
|
||||
I: Integer;
|
||||
StrCmp: function(const S1, S2: String): Integer;
|
||||
begin
|
||||
for i := 0 to FFileSources.Count - 1 do
|
||||
if CaseSensitive then
|
||||
StrCmp:= @CompareStr
|
||||
else begin
|
||||
StrCmp:= @CompareText;
|
||||
end;
|
||||
for I := 0 to FFileSources.Count - 1 do
|
||||
begin
|
||||
if (FFileSources[i].IsClass(FileSourceClass)) and
|
||||
(FFileSources[i].CurrentAddress = Address) then
|
||||
if (FFileSources[I].IsClass(FileSourceClass)) and
|
||||
(StrCmp(FFileSources[I].CurrentAddress, Address) = 0) then
|
||||
begin
|
||||
Result := FFileSources[i];
|
||||
Result := FFileSources[I];
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -197,7 +197,10 @@ begin
|
|||
URI:= ParseURI(aPath);
|
||||
RemotePath:= NormalizePathDelimiters(URI.Path + URI.Document);
|
||||
RemotePath:= IncludeTrailingPathDelimiter(RemotePath);
|
||||
FileSource:= FileSourceManager.Find(aFileSourceClass, URI.Protocol + '://' + URI.Host);
|
||||
FileSource:= FileSourceManager.Find(aFileSourceClass,
|
||||
URI.Protocol + '://' + URI.Host,
|
||||
not SameText(URI.Protocol, 'smb')
|
||||
);
|
||||
if Assigned(FileSource) then
|
||||
aFileView.AddFileSource(FileSource, RemotePath)
|
||||
else begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue