소스 검색

Bug 1944: Allow displaying all VMS file revisions with FTP protocol

https://winscp.net/tracker/1944
(cherry picked from commit 24ac52a27f1ace9e48f23ef9e83f896d8de41254)

# Conflicts:
#	source/core/FtpFileSystem.h

Source commit: 577fc27cbf3b106d237ab97a83816c1377274ded
Martin Prikryl 4 년 전
부모
커밋
29ff9efc2c

+ 5 - 5
source/core/FtpFileSystem.cpp

@@ -377,7 +377,7 @@ void __fastcall TFTPFileSystem::Open()
   FVMS = false;
   FFileZilla = false;
   FTransferActiveImmediately = (Data->FtpTransferActiveImmediately == asOn);
-  FVmsAllRevisions = false;
+  FVMSAllRevisions = Data->VMSAllRevisions;
 
   FSessionInfo.LoginTime = Now();
   FSessionInfo.CertificateVerifiedManually = false;
@@ -2405,12 +2405,12 @@ void __fastcall TFTPFileSystem::ReadFile(const UnicodeString FileName,
       {
         NameOnly = FileName.SubString(P + 1, FileName.Length() - P - 1);
       }
-      DebugAssert(!FVmsAllRevisions);
-      TAutoFlag VmsAllRevisionsFlag(FVmsAllRevisions);
+      DebugAssert(!FVMSAllRevisions);
+      TAutoFlag VMSAllRevisionsFlag(FVMSAllRevisions);
       if (FVMS && (NameOnly.Pos(L";") > 2))
       {
         FTerminal->LogEvent(L"VMS versioned file detected, asking for all revisions");
-        FVmsAllRevisions = true;
+        FVMSAllRevisions = true;
       }
       TRemoteFile * AFile = NULL;
       // FZAPI does not have efficient way to read properties of one file.
@@ -2786,7 +2786,7 @@ int __fastcall TFTPFileSystem::GetOptionVal(int OptionID) const
       break;
 
     case OPTION_VMSALLREVISIONS:
-      Result = FVmsAllRevisions ? TRUE : FALSE;
+      Result = FVMSAllRevisions ? TRUE : FALSE;
       break;
 
     case OPTION_SPEEDLIMIT_DOWNLOAD_TYPE:

+ 1 - 1
source/core/FtpFileSystem.h

@@ -300,7 +300,7 @@ private:
   bool FFileZilla;
   bool FFileTransferAny;
   bool FLoggedIn;
-  bool FVmsAllRevisions;
+  bool FVMSAllRevisions;
   bool FForceReadSymlink;
   mutable UnicodeString FOptionScratch;
 };

+ 9 - 0
source/core/SessionData.cpp

@@ -220,6 +220,7 @@ void __fastcall TSessionData::DefaultSettings()
   LookupUserGroups = asAuto;
   EOLType = eolLF;
   TrimVMSVersions = false;
+  VMSAllRevisions = false;
   Shell = L""; //default shell
   ReturnVar = L"";
   ExitCode1IsError = false;
@@ -371,6 +372,7 @@ void __fastcall TSessionData::NonPersistant()
   PROPERTY(LookupUserGroups); \
   PROPERTY(EOLType); \
   PROPERTY(TrimVMSVersions); \
+  PROPERTY(VMSAllRevisions); \
   PROPERTY(Shell); \
   PROPERTY(ClearAliases); \
   PROPERTY(Scp1Compatibility); \
@@ -742,6 +744,7 @@ void __fastcall TSessionData::DoLoad(THierarchicalStorage * Storage, bool PuttyI
   LookupUserGroups = Storage->ReadEnum(L"LookupUserGroups2", LookupUserGroups, AutoSwitchMapping);
   EOLType = (TEOLType)Storage->ReadInteger(L"EOLType", EOLType);
   TrimVMSVersions = Storage->ReadBool(L"TrimVMSVersions", TrimVMSVersions);
+  VMSAllRevisions = Storage->ReadBool(L"VMSAllRevisions", VMSAllRevisions);
   NotUtf = Storage->ReadEnum(L"Utf", Storage->ReadEnum(L"SFTPUtfBug", NotUtf), AutoSwitchReversedMapping);
   InternalEditorEncoding = Storage->ReadInteger(L"InternalEditorEncoding", InternalEditorEncoding);
 
@@ -1133,6 +1136,7 @@ void __fastcall TSessionData::DoSave(THierarchicalStorage * Storage,
     WRITE_DATA_EX(Integer, L"LookupUserGroups2", LookupUserGroups, );
     WRITE_DATA(Integer, EOLType);
     WRITE_DATA(Bool, TrimVMSVersions);
+    WRITE_DATA(Bool, VMSAllRevisions);
     Storage->DeleteValue(L"SFTPUtfBug");
     WRITE_DATA_EX(Integer, L"Utf", NotUtf, );
     WRITE_DATA(Integer, InternalEditorEncoding);
@@ -2968,6 +2972,11 @@ void __fastcall TSessionData::SetTrimVMSVersions(bool value)
   SET_SESSION_PROPERTY(TrimVMSVersions);
 }
 //---------------------------------------------------------------------------
+void __fastcall TSessionData::SetVMSAllRevisions(bool value)
+{
+  SET_SESSION_PROPERTY(VMSAllRevisions);
+}
+//---------------------------------------------------------------------------
 TDateTime __fastcall TSessionData::GetTimeoutDT()
 {
   return SecToDateTime(Timeout);

+ 3 - 0
source/core/SessionData.h

@@ -133,6 +133,7 @@ private:
   bool FClearAliases;
   TEOLType FEOLType;
   bool FTrimVMSVersions;
+  bool FVMSAllRevisions;
   UnicodeString FPublicKeyFile;
   UnicodeString FPassphrase;
   UnicodeString FPuttyProtocol;
@@ -318,6 +319,7 @@ private:
   void __fastcall SetDefaultShell(bool value);
   void __fastcall SetEOLType(TEOLType value);
   void __fastcall SetTrimVMSVersions(bool value);
+  void __fastcall SetVMSAllRevisions(bool value);
   void __fastcall SetLookupUserGroups(TAutoSwitch value);
   void __fastcall SetReturnVar(UnicodeString value);
   void __fastcall SetExitCode1IsError(bool value);
@@ -600,6 +602,7 @@ public:
   __property bool DetectReturnVar = { read = GetDetectReturnVar, write = SetDetectReturnVar };
   __property TEOLType EOLType = { read = FEOLType, write = SetEOLType };
   __property bool TrimVMSVersions = { read = FTrimVMSVersions, write = SetTrimVMSVersions };
+  __property bool VMSAllRevisions = { read = FVMSAllRevisions, write = SetVMSAllRevisions };
   __property TAutoSwitch LookupUserGroups = { read = FLookupUserGroups, write = SetLookupUserGroups };
   __property UnicodeString ReturnVar = { read = FReturnVar, write = SetReturnVar };
   __property bool ExitCode1IsError = { read = FExitCode1IsError, write = SetExitCode1IsError };

+ 3 - 3
source/core/SessionInfo.cpp

@@ -1408,10 +1408,10 @@ void __fastcall TSessionLog::DoAddStartupInfo(TSessionData * Data)
       (BooleanToEngStr(Data->DeleteToRecycleBin),
        BooleanToEngStr(Data->OverwrittenToRecycleBin),
        Data->RecycleBinPath));
-    if (Data->TrimVMSVersions)
+    if (Data->TrimVMSVersions || Data->VMSAllRevisions)
     {
-      ADF(L"Trim VMS versions: %s",
-        (BooleanToEngStr(Data->TrimVMSVersions)));
+      ADF(L"Trim VMS versions: %s; VMS all revisions: %s",
+        (BooleanToEngStr(Data->TrimVMSVersions), BooleanToEngStr(Data->VMSAllRevisions)));
     }
     UnicodeString TimeInfo;
     if ((Data->FSProtocol == fsSFTP) || (Data->FSProtocol == fsSFTPonly) || (Data->FSProtocol == fsSCPonly) || (Data->FSProtocol == fsWebDAV))

+ 2 - 0
source/forms/SiteAdvanced.cpp

@@ -175,6 +175,7 @@ void __fastcall TSiteAdvancedDialog::LoadSession()
     TimeDifferenceAutoCheck->Checked = FSessionData->TimeDifferenceAuto;
 
     TrimVMSVersionsCheck->Checked = FSessionData->TrimVMSVersions;
+    VMSAllRevisionsCheck->Checked = FSessionData->VMSAllRevisions;
 
     PuttySettingsEdit->Text = FSessionData->PuttySettings;
 
@@ -584,6 +585,7 @@ void __fastcall TSiteAdvancedDialog::SaveSession(TSessionData * SessionData)
   SessionData->TimeDifferenceAuto = TimeDifferenceAutoCheck->Checked;
 
   SessionData->TrimVMSVersions = TrimVMSVersionsCheck->Checked;
+  SessionData->VMSAllRevisions = VMSAllRevisionsCheck->Checked;
 
   SessionData->PuttySettings = PuttySettingsEdit->Text;
 

+ 10 - 2
source/forms/SiteAdvanced.dfm

@@ -861,13 +861,13 @@ object SiteAdvancedDialog: TSiteAdvancedDialog
           Left = 0
           Top = 6
           Width = 393
-          Height = 224
+          Height = 251
           Anchors = [akLeft, akTop, akRight]
           Caption = 'Protocol options'
           TabOrder = 0
           DesignSize = (
             393
-            224)
+            251)
           object Label25: TLabel
             Left = 12
             Top = 42
@@ -976,6 +976,14 @@ object SiteAdvancedDialog: TSiteAdvancedDialog
             TabOrder = 5
             OnChange = DataChange
           end
+          object VMSAllRevisionsCheck: TCheckBox
+            Left = 12
+            Top = 220
+            Width = 309
+            Height = 17
+            Caption = 'Display all file &revisions on VMS servers'
+            TabOrder = 6
+          end
         end
       end
       object S3Sheet: TTabSheet

+ 1 - 0
source/forms/SiteAdvanced.h

@@ -287,6 +287,7 @@ __published:
   TGroupBox *S3AuthenticationGroup;
   TLabel *S3SessionTokenLabel;
   TMemo *S3SessionTokenMemo;
+  TCheckBox *VMSAllRevisionsCheck;
   void __fastcall DataChange(TObject *Sender);
   void __fastcall FormShow(TObject *Sender);
   void __fastcall PageControlChange(TObject *Sender);