From: Peter Penz Date: Mon, 17 Jan 2011 06:46:33 +0000 (+0000) Subject: Don't assure the visibility of the leaf, if another directory has been opened by... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/4d3e52e92e75195b4852e0899498dd7680c0e667?ds=inline Don't assure the visibility of the leaf, if another directory has been opened by the [+]-toggle. CCBUG: 263344 svn path=/trunk/KDE/kdebase/apps/; revision=1214979 --- 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; + } } }