Browse Source

Updating drive drop down list before trying to update its selection

Source commit: 8a6f36fc7d997bff1426a4bd701d67f69d9bb70e
Martin Prikryl 1 month ago
parent
commit
9bbbefe62f
1 changed files with 4 additions and 8 deletions
  1. 4 8
      source/forms/ScpCommander.cpp

+ 4 - 8
source/forms/ScpCommander.cpp

@@ -669,6 +669,10 @@ void __fastcall TScpCommanderForm::SessionChanged(bool Replaced)
 
       if (ManagedSession->LocalBrowser)
       {
+        // Particularly, when switching from a remote to a local-local session,
+        // the other local dir view path may not change at all,
+        // so the path combo box would retain the remote path.
+        OtherLocalPathComboUpdateDrives();
         RestoreSessionLocalDirView(OtherLocalDirView, ManagedSession->StateData->OtherLocalDirectory);
       }
 
@@ -704,14 +708,6 @@ void __fastcall TScpCommanderForm::SessionChanged(bool Replaced)
     {
       AnnounceLocalStates(RestoreState, ManagedSession->LocalBrowser, NULL, NULL);
     }
-
-    if (ManagedSession->LocalBrowser)
-    {
-      // Particularly, when switching from a remote to a local-local session,
-      // the other local dir view path may not change at all,
-      // so the path combo box would retain the remote path.
-      OtherLocalPathComboUpdateDrives();
-    }
   }
 }
 //---------------------------------------------------------------------------