Skip to content

Commit

Permalink
Bug 2060: Failure when changing remote folder using directory tree wh…
Browse files Browse the repository at this point in the history
…ile previous directory is still loading (2nd)

https://winscp.net/tracker/2060

Source commit: 14adf07852fc0164a565161262cff058d9071377
  • Loading branch information
martinprikryl committed Feb 25, 2022
1 parent 6d961ac commit 1d2b699
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/components/UnixDriveView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ __fastcall TCustomUnixDriveView::TCustomUnixDriveView(TComponent* Owner) :
FDummyDragFile = NULL;
FPendingDelete = new TList();
FDragDropFilesEx->PreferCopy = true;
FChangingDirectory = false;
}
//---------------------------------------------------------------------------
__fastcall TCustomUnixDriveView::~TCustomUnixDriveView()
Expand Down Expand Up @@ -467,7 +468,7 @@ bool __fastcall TCustomUnixDriveView::CanChange(TTreeNode * Node)
{
return
TCustomDriveView::CanChange(Node) &&
FCanChange;
!FChangingDirectory;
}
//---------------------------------------------------------------------------
void __fastcall TCustomUnixDriveView::Change(TTreeNode * Node)
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions source/components/UnixDriveView.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ friend class TUnixDirView;
bool FShowInaccesibleDirectories;
TRemoteFile * FDummyDragFile;
TList * FPendingDelete;
bool FChangingDirectory;

bool __fastcall IsRootNameStored();
void __fastcall SetShowInaccesibleDirectories(bool value);
Expand Down

0 comments on commit 1d2b699

Please sign in to comment.