]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't assure the visibility of the leaf, if another directory has been opened by...
authorPeter Penz <peter.penz19@gmail.com>
Mon, 17 Jan 2011 06:46:33 +0000 (06:46 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 17 Jan 2011 06:46:33 +0000 (06:46 +0000)
CCBUG: 263344

svn path=/trunk/KDE/kdebase/apps/; revision=1214979

src/panels/folders/folderspanel.cpp

index 1913a85d3ba3e8b505465319a741c04e39a0edf9..5cfce59e26cb8ef48492e7c02009b58c5c8c0ee4 100644 (file)
@@ -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;
+        }
     }
 }