diff --git a/source/components/DirView.cpp b/source/components/DirView.cpp index f7fe7ad37..9379e44f1 100644 --- a/source/components/DirView.cpp +++ b/source/components/DirView.cpp @@ -118,3 +118,15 @@ bool __fastcall TDirView::TryGetLastPath(UnicodeString Drive, UnicodeString & Pa } return Result; } +//--------------------------------------------------------------------------- +void __fastcall TDirView::CreateWnd() +{ + #ifndef DESIGN_ONLY + UnicodeString StartupSequenceTag = Name.SubString(1, 1); + AddStartupSequence(L"Z" + StartupSequenceTag); + #endif + TDirViewInt::CreateWnd(); + #ifndef DESIGN_ONLY + AddStartupSequence(L"a" + StartupSequenceTag); + #endif +} diff --git a/source/components/DirView.h b/source/components/DirView.h index 551feb17a..3165b884e 100644 --- a/source/components/DirView.h +++ b/source/components/DirView.h @@ -20,6 +20,7 @@ protected: virtual void __fastcall IconUpdateDequeue(int Index); virtual void __fastcall PathChanged(); virtual bool __fastcall TryGetLastPath(UnicodeString Drive, UnicodeString & Path); + virtual void __fastcall CreateWnd(); private: std::set FIconUpdateSet; diff --git a/source/components/DriveView.cpp b/source/components/DriveView.cpp index c90da6e80..3853b6892 100644 --- a/source/components/DriveView.cpp +++ b/source/components/DriveView.cpp @@ -5,6 +5,7 @@ #include #include "DriveView.h" #include "IEDriveInfo.h" +#include "DirView.h" //--------------------------------------------------------------------------- #pragma package(smart_init) //--------------------------------------------------------------------------- @@ -56,3 +57,15 @@ bool __fastcall TDriveView::GetNextDriveStatus(int & Iterator, UnicodeString * D } return Result; } +//--------------------------------------------------------------------------- +void __fastcall TDriveView::CreateWnd() +{ + #ifndef DESIGN_ONLY + UnicodeString StartupSequenceTag = Name.SubString(1, 1); + AddStartupSequence(L"Q" + StartupSequenceTag); + #endif + TDriveViewInt::CreateWnd(); + #ifndef DESIGN_ONLY + AddStartupSequence(L"V" + StartupSequenceTag); + #endif +} diff --git a/source/components/DriveView.h b/source/components/DriveView.h index 8bb6bd052..b4b71fc27 100644 --- a/source/components/DriveView.h +++ b/source/components/DriveView.h @@ -17,6 +17,7 @@ protected: std::unique_ptr FDriveStatus; virtual bool __fastcall GetNextDriveStatus(int & Iterator, UnicodeString * Drive, TDriveStatus *& Status); + virtual void __fastcall CreateWnd(); private: TDriveStatus * GetDriveStatus(int Index); diff --git a/source/core/Common.cpp b/source/core/Common.cpp index b6b53cab6..320d948a3 100644 --- a/source/core/Common.cpp +++ b/source/core/Common.cpp @@ -4533,4 +4533,19 @@ TStrings * ProcessFeatures(TStrings * Features, const UnicodeString & AFeaturesO } return Result.release(); } +//--------------------------------------------------------------------------- +static TDateTime LastStartupStartupSequence(Now()); +UnicodeString StartupSequence; +//--------------------------------------------------------------------------- +int TensOfSecondBetween(TDateTime ANow, TDateTime AThen) +{ + return static_cast(MilliSecondsBetween(ANow, AThen) / 100); +} +//--------------------------------------------------------------------------- +void AddStartupSequence(const UnicodeString & Tag) +{ + int SequenceTensOfSecond = TensOfSecondBetween(Now(), LastStartupStartupSequence); + LastStartupStartupSequence = Now(); + AddToList(StartupSequence, FORMAT(L"%s:%d", (Tag, SequenceTensOfSecond)), L","); +} //--------------------------------------------------------------------- diff --git a/source/core/Common.h b/source/core/Common.h index 65a85fc32..7c2ea903d 100644 --- a/source/core/Common.h +++ b/source/core/Common.h @@ -225,6 +225,9 @@ NORETURN void NotSupported(); NORETURN void NotImplemented(); UnicodeString GetDividerLine(); TStrings * ProcessFeatures(TStrings * Features, const UnicodeString & FeaturesOverride); +int TensOfSecondBetween(TDateTime ANow, TDateTime AThen); +extern UnicodeString StartupSequence; +void AddStartupSequence(const UnicodeString & Tag); //--------------------------------------------------------------------------- struct TSearchRecSmart : public TSearchRec { diff --git a/source/forms/CustomScpExplorer.cpp b/source/forms/CustomScpExplorer.cpp index 87682da34..57a7b9bbb 100644 --- a/source/forms/CustomScpExplorer.cpp +++ b/source/forms/CustomScpExplorer.cpp @@ -10732,6 +10732,7 @@ void __fastcall TCustomScpExplorerForm::CreateWnd() FQueueDragDropFilesEx->OnDragEnter = QueueDDDragEnter; FQueueDragDropFilesEx->OnDragLeave = QueueDDDragLeave; } + AddStartupSequence(L"Y"); } //--------------------------------------------------------------------------- void __fastcall TCustomScpExplorerForm::DestroyWnd() diff --git a/source/windows/WinInterface.h b/source/windows/WinInterface.h index 25065f065..44e4d546b 100644 --- a/source/windows/WinInterface.h +++ b/source/windows/WinInterface.h @@ -560,7 +560,6 @@ UnicodeString DumpCallstackFileName(int ProcessId); void CheckConfigurationForceSave(); void InterfaceStarted(); void InterfaceStartDontMeasure(); -void AddStartupSequence(const UnicodeString & Tag); //--------------------------------------------------------------------------- #define HIDDEN_WINDOW_NAME L"WinSCPHiddenWindow3" //--------------------------------------------------------------------------- diff --git a/source/windows/WinMain.cpp b/source/windows/WinMain.cpp index 5c6e339e5..7ad20fa8d 100644 --- a/source/windows/WinMain.cpp +++ b/source/windows/WinMain.cpp @@ -474,8 +474,6 @@ void __fastcall TStartupThread::Execute() //--------------------------------------------------------------------------- static TStartupThread * StartupThread(new TStartupThread()); static TDateTime Started(Now()); -static TDateTime LastStartupStartupSequence(Now()); -static UnicodeString StartupSequence; static int LifetimeRuns = -1; //--------------------------------------------------------------------------- void InterfaceStartDontMeasure() @@ -484,18 +482,6 @@ void InterfaceStartDontMeasure() StartupThread->Terminate(); } //--------------------------------------------------------------------------- -int TensOfSecondBetween(TDateTime ANow, TDateTime AThen) -{ - return static_cast(MilliSecondsBetween(ANow, AThen) / 100); -} -//--------------------------------------------------------------------------- -void AddStartupSequence(const UnicodeString & Tag) -{ - int SequenceTensOfSecond = TensOfSecondBetween(Now(), LastStartupStartupSequence); - LastStartupStartupSequence = Now(); - AddToList(StartupSequence, FORMAT(L"%s:%d", (Tag, SequenceTensOfSecond)), L","); -} -//--------------------------------------------------------------------------- void InterfaceStarted() { if (Started != TDateTime())