Bladeren bron

Bug 1427: With synchronized browsing on, the Home Directory command opens home directory in both panels

https://winscp.net/tracker/1427

Source commit: 5f97fc43d6ea2f2bda9833edbf897d8753aebed1
Martin Prikryl 9 jaren geleden
bovenliggende
commit
9c8c5c0941
2 gewijzigde bestanden met toevoegingen van 16 en 1 verwijderingen
  1. 15 1
      source/forms/ScpCommander.cpp
  2. 1 0
      source/forms/ScpCommander.h

+ 15 - 1
source/forms/ScpCommander.cpp

@@ -2041,8 +2041,16 @@ void __fastcall TScpCommanderForm::LocalDriveViewRefreshDrives(TObject * /*Sende
 //---------------------------------------------------------------------------
 void __fastcall TScpCommanderForm::HomeDirectory(TOperationSide Side)
 {
+  bool SynchronizeBrowsing = NonVisualDataModule->SynchronizeBrowsingAction->Checked;
+
   TSynchronizedBrowsingGuard SynchronizedBrowsingGuard;
+
   TCustomScpExplorerForm::HomeDirectory(Side);
+
+  if (SynchronizeBrowsing)
+  {
+    TCustomScpExplorerForm::HomeDirectory(GetOtherSize(Side));
+  }
 }
 //---------------------------------------------------------------------------
 void __fastcall TScpCommanderForm::QueueSubmenuItemPopup(
@@ -2057,9 +2065,15 @@ void __fastcall TScpCommanderForm::DoFocusRemotePath(UnicodeString Path)
   TCustomScpExplorerForm::DoFocusRemotePath(Path);
 }
 //---------------------------------------------------------------------------
+TOperationSide __fastcall TScpCommanderForm::GetOtherSize(TOperationSide Side)
+{
+  Side = GetSide(Side);
+  return ((Side == osLocal) ? osRemote : osLocal);
+}
+//---------------------------------------------------------------------------
 void __fastcall TScpCommanderForm::HistoryGo(TOperationSide Side, int Index)
 {
-  TOperationSide OtherSide = ((Side == osLocal) ? osRemote : osLocal);
+  TOperationSide OtherSide = GetOtherSize(Side);
   if (NonVisualDataModule->SynchronizeBrowsingAction->Checked &&
       ((Index < 0) ? (-Index < DirView(OtherSide)->BackCount) : (Index < DirView(OtherSide)->ForwardCount)))
   {

+ 1 - 0
source/forms/ScpCommander.h

@@ -508,6 +508,7 @@ private:
   void __fastcall SetShortcuts();
   void __fastcall UpdatePanelsPathLabelsStatus();
   void __fastcall LocalDefaultDirectory();
+  TOperationSide __fastcall GetOtherSize(TOperationSide Side);
 
 protected:
   virtual bool __fastcall CopyParamDialog(TTransferDirection Direction,