mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: FTP - capability to create connection copy
This commit is contained in:
parent
968840e517
commit
9825c04bdc
2 changed files with 36 additions and 8 deletions
|
|
@ -70,7 +70,6 @@ end;"/>
|
|||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
<UseHeaptrc Value="True"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<PassLinkerOptions Value="True"/>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
-------------------------------------------------------------------------
|
||||
Wfx plugin for working with File Transfer Protocol
|
||||
|
||||
Copyright (C) 2009-2020 Alexander Koblov (alexx2000@mail.ru)
|
||||
Copyright (C) 2009-2023 Alexander Koblov (alexx2000@mail.ru)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
|
@ -780,24 +780,53 @@ end;
|
|||
function FsRenMovFileW(OldName, NewName: PWideChar; Move, OverWrite: BOOL;
|
||||
RemoteInfo: pRemoteInfo): Integer; dcpcall;
|
||||
var
|
||||
I: Integer;
|
||||
O, N: Integer;
|
||||
FtpSend: TFTPSendEx;
|
||||
sOldName: AnsiString;
|
||||
sNewName: AnsiString;
|
||||
Connection: TConnection;
|
||||
begin
|
||||
Result := FS_FILE_NOTSUPPORTED;
|
||||
|
||||
if not Move then Exit;
|
||||
if not Move then
|
||||
begin
|
||||
if (ExtractFileDir(OldName) = PathDelim) and (WideChar(OldName[1]) <> '<') and
|
||||
(ExtractFileDir(NewName) = PathDelim) and (WideChar(NewName[1]) <> '<') then
|
||||
begin
|
||||
O:= ConnectionList.IndexOf(OldName + 1);
|
||||
if O < 0 then
|
||||
Result:= FS_FILE_NOTFOUND
|
||||
else begin
|
||||
sNewName:= RepairConnectionName(UTF16ToUTF8(UnicodeString(NewName + 1)));
|
||||
N:= ConnectionList.IndexOf(sNewName);
|
||||
if (N >= 0) then
|
||||
begin
|
||||
if not OverWrite then Exit(FS_FILE_EXISTS);
|
||||
Connection:= TConnection(ConnectionList.Objects[N]);
|
||||
end
|
||||
else begin
|
||||
Connection:= TConnection.Create;
|
||||
ConnectionList.AddObject(sNewName, Connection);
|
||||
end;
|
||||
Connection.Assign(TConnection(ConnectionList.Objects[O]));
|
||||
Connection.ConnectionName:= sNewName;
|
||||
|
||||
WriteConnectionList;
|
||||
Result:= FS_FILE_OK;
|
||||
end;
|
||||
end;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if (ExtractFileDir(OldName) = PathDelim) and (WideChar(OldName[1]) <> '<') then
|
||||
begin
|
||||
I:= ConnectionList.IndexOf(OldName + 1);
|
||||
if I < 0 then
|
||||
O:= ConnectionList.IndexOf(OldName + 1);
|
||||
if O < 0 then
|
||||
Result:= FS_FILE_NOTFOUND
|
||||
else
|
||||
begin
|
||||
ConnectionList[I]:= RepairConnectionName(UTF16ToUTF8(UnicodeString(NewName + 1)));
|
||||
TConnection(ConnectionList.Objects[I]).ConnectionName:= ConnectionList[I];
|
||||
ConnectionList[O]:= RepairConnectionName(UTF16ToUTF8(UnicodeString(NewName + 1)));
|
||||
TConnection(ConnectionList.Objects[O]).ConnectionName:= ConnectionList[O];
|
||||
WriteConnectionList;
|
||||
Result:= FS_FILE_OK;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue