Skip to content

Commit

Permalink
Bug 1630: Login dialog opens slowly, when there is a lot of stored si…
Browse files Browse the repository at this point in the history
…tes with a color

https://winscp.net/tracker/1630

Source commit: 024d0e55f77182702ddf3e6247456974477f8e5b
  • Loading branch information
martinprikryl committed Apr 5, 2018
1 parent 9cf4603 commit d35ac0a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions source/forms/Login.cpp
Expand Up @@ -329,14 +329,22 @@ TTreeNode * __fastcall TLoginDialog::AddSession(TSessionData * Data)
//---------------------------------------------------------------------------
void __fastcall TLoginDialog::UpdateNodeImages()
{
TTreeNode * Node = SessionTree->Items->GetFirstNode();
while (Node != NULL)
SessionTree->Images->BeginUpdate();
try
{
if (IsSiteNode(Node))
TTreeNode * Node = SessionTree->Items->GetFirstNode();
while (Node != NULL)
{
UpdateNodeImage(Node);
if (IsSiteNode(Node))
{
UpdateNodeImage(Node);
}
Node = Node->GetNext();
}
Node = Node->GetNext();
}
__finally
{
SessionTree->Images->EndUpdate();
}
}
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -387,6 +395,7 @@ void __fastcall TLoginDialog::LoadSessions()
{
TAutoFlag LoadingFlag(FLoading);
SessionTree->Items->BeginUpdate();
SessionTree->Images->BeginUpdate();
try
{
// optimization
Expand All @@ -411,6 +420,7 @@ void __fastcall TLoginDialog::LoadSessions()
// SortType is set (not having set the data property), so we would have to
// call AlphaSort here explicitly
SessionTree->SortType = Comctrls::stBoth;
SessionTree->Images->EndUpdate();
SessionTree->Items->EndUpdate();
}
SessionTree->Selected = SessionTree->Items->GetFirstNode();
Expand Down

0 comments on commit d35ac0a

Please sign in to comment.