浏览代码

Bug 2060: Failure when changing remote folder using directory tree while previous directory is still loading (2nd)

https://winscp.net/tracker/2060

Source commit: 14adf07852fc0164a565161262cff058d9071377
Martin Prikryl 3 年之前
父节点
当前提交
1d2b6994a8
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 4 3
      source/components/UnixDriveView.cpp
  2. 1 0
      source/components/UnixDriveView.h

+ 4 - 3
source/components/UnixDriveView.cpp

@@ -52,6 +52,7 @@ __fastcall TCustomUnixDriveView::TCustomUnixDriveView(TComponent* Owner) :
   FDummyDragFile = NULL;
   FPendingDelete = new TList();
   FDragDropFilesEx->PreferCopy = true;
+  FChangingDirectory = false;
 }
 //---------------------------------------------------------------------------
 __fastcall TCustomUnixDriveView::~TCustomUnixDriveView()
@@ -467,7 +468,7 @@ bool __fastcall TCustomUnixDriveView::CanChange(TTreeNode * Node)
 {
   return
     TCustomDriveView::CanChange(Node) &&
-    FCanChange;
+    !FChangingDirectory;
 }
 //---------------------------------------------------------------------------
 void __fastcall TCustomUnixDriveView::Change(TTreeNode * Node)
@@ -512,8 +513,8 @@ void __fastcall TCustomUnixDriveView::Change(TTreeNode * Node)
           {
             // Prevent curther changes while loading the folder.
             // Particularly prevent user from trying to proceed with incremental search.
-            TValueRestorer<bool> CanChangeRestorer(FCanChange);
-            FCanChange = false;
+            TValueRestorer<bool> ChangingDirectoryRestorer(FChangingDirectory);
+            FChangingDirectory = true;
             Terminal->ChangeDirectory(NodePathName(Node));
           }
           TCustomDriveView::Change(Node);

+ 1 - 0
source/components/UnixDriveView.h

@@ -98,6 +98,7 @@ private:
   bool FShowInaccesibleDirectories;
   TRemoteFile * FDummyDragFile;
   TList * FPendingDelete;
+  bool FChangingDirectory;
 
   bool __fastcall IsRootNameStored();
   void __fastcall SetShowInaccesibleDirectories(bool value);