┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/panels/folders/folderspanel.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp
index 1913a85d3..5cfce59e2 100644
--- a/src/panels/folders/folderspanel.cpp
+++ b/src/panels/folders/folderspanel.cpp
@@ -263,14 +263,6 @@ void FoldersPanel::updateMouseButtons()
void FoldersPanel::slotDirListerCompleted()
{
m_treeView->resizeColumnToContents(DolphinModel::Name);
-
- if (m_setLeafVisible) {
- // Invoke scrollToLeaf() asynchronously. This assures that
- // the horizontal scrollbar is shown after resizing the column
- // (otherwise the scrollbar might hide the leaf).
- QTimer::singleShot(0, this, SLOT(scrollToLeaf()));
- m_setLeafVisible = false;
- }
}
void FoldersPanel::slotHorizontalScrollBarMoved(int value)
@@ -315,9 +307,18 @@ void FoldersPanel::selectLeafDirectory()
{
const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_leafDir);
const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
+
if (proxyIndex.isValid()) {
QItemSelectionModel* selModel = m_treeView->selectionModel();
selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::ClearAndSelect);
+
+ if (m_setLeafVisible) {
+ // Invoke scrollToLeaf() asynchronously. This assures that
+ // the horizontal scrollbar is shown after resizing the column
+ // (otherwise the scrollbar might hide the leaf).
+ QTimer::singleShot(0, this, SLOT(scrollToLeaf()));
+ m_setLeafVisible = false;
+ }
}
}