code simplifications like done in the column view

svn path=/trunk/KDE/kdebase/apps/; revision=717229
This commit is contained in:
Peter Penz 2007-09-26 10:46:25 +00:00
parent 28372c1724
commit 1c819fb0ed

View file

@ -222,9 +222,6 @@ void TreeViewSidebarPage::expandToLeafDir()
void TreeViewSidebarPage::loadSubTree()
{
disconnect(m_dirLister, SIGNAL(completed()),
this, SLOT(loadSubTree()));
QItemSelectionModel* selModel = m_treeView->selectionModel();
selModel->clearSelection();
@ -240,11 +237,10 @@ void TreeViewSidebarPage::loadSubTree()
const QModelIndex proxyIndex = m_proxyModel->mapFromSource(index);
m_treeView->scrollTo(proxyIndex);
selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::Select);
} else {
} else if (m_dirListerCompleted) {
// Load all sub directories that need to get expanded for making
// the leaf directory visible. The slot triggerExpanding() will
// get invoked if the expanding has been finished.
Q_ASSERT(m_dirListerCompleted);
m_dolphinModel->expandToUrl(m_leafDir);
}
}
@ -258,9 +254,9 @@ void TreeViewSidebarPage::slotDirListerStarted(const KUrl& url)
void TreeViewSidebarPage::slotDirListerCompleted()
{
m_dirListerCompleted = true;
QMetaObject::invokeMethod(this, "loadSubTree", Qt::QueuedConnection);
}
void TreeViewSidebarPage::loadTree(const KUrl& url)
{
Q_ASSERT(m_dirLister != 0);
@ -275,9 +271,7 @@ void TreeViewSidebarPage::loadTree(const KUrl& url)
baseUrl = url;
}
connect(m_dirLister, SIGNAL(completed()),
this, SLOT(loadSubTree()));
if ((m_dirLister->url() != baseUrl) || !m_dirListerCompleted) {
if (m_dirLister->url() != baseUrl) {
m_dirLister->stop();
m_dirLister->openUrl(baseUrl);
} else {