From f3fecb0f9f32e5e4fed982e654d3baf84fc38a62 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Thu, 29 Oct 2009 18:36:24 +0000 Subject: [PATCH] Upstream tarball 9848 --- .svn-revision | 2 +- src/DirectoryTreeCtrl.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.svn-revision b/.svn-revision index 3685bb3e..6f263a52 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -9847 +9848 diff --git a/src/DirectoryTreeCtrl.cpp b/src/DirectoryTreeCtrl.cpp index 3df38692..f4f87e37 100644 --- a/src/DirectoryTreeCtrl.cpp +++ b/src/DirectoryTreeCtrl.cpp @@ -161,7 +161,10 @@ void CDirectoryTreeCtrl::OnRButtonDown(wxTreeEvent& evt) if (m_IsRemote) { SelectItem(evt.GetItem()); // looks weird otherwise } else { + // this might take awhile, so change the cursor + ::wxSetCursor(*wxHOURGLASS_CURSOR); MarkChildren(evt.GetItem(), !IsBold(evt.GetItem()), false); + ::wxSetCursor(*wxSTANDARD_CURSOR); HasChanged = true; } } @@ -329,15 +332,12 @@ void CDirectoryTreeCtrl::UpdateSharedDirectories() bool CDirectoryTreeCtrl::HasSharedSubdirectory(const CPath& path) { - SharedMap::iterator it = m_lstShared.begin(); - for (; it != m_lstShared.end(); ++it) { - // IsSameDir to avoid the case where 'path' itself is shared. - if (it->second.StartsWith(path) && (!it->second.IsSameDir(path))) { - return true; - } + SharedMap::iterator it = m_lstShared.upper_bound(GetKey(path) + wxFileName::GetPathSeparator()); + if (it == m_lstShared.end()) { + return false; } - - return false; + // upper_bound() doesn't find the directory itself, so no need to check for that. + return it->second.StartsWith(path); } -- 2.11.4.GIT