diff options
| author | Frank Reininghaus <[email protected]> | 2010-02-16 11:12:00 +0000 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2010-02-16 11:12:00 +0000 |
| commit | c7515e9e90c5fd81790759444b82cdc3f71fcbf6 (patch) | |
| tree | 8ced79c495a74d4fb3a4a1781d222d6c020053a8 /src | |
| parent | 323db2c9b5b2b244a0aa7fe7d4724dc29dfa96a2 (diff) | |
Make sure that DolphinView's m_expanderActive member is handled
correctly, and emit DolphinDetailsViewExpander's completed() signal
only if the folder loading is really finished. This fixes possible
problems when restoring the current item and scroll position of the
view if these require a preceding folder expansion.
svn path=/trunk/KDE/kdebase/apps/; revision=1090926
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphindetailsviewexpander.cpp | 21 | ||||
| -rw-r--r-- | src/dolphinview.cpp | 2 |
2 files changed, 7 insertions, 16 deletions
diff --git a/src/dolphindetailsviewexpander.cpp b/src/dolphindetailsviewexpander.cpp index cfab3bf12..0f3d3fde1 100644 --- a/src/dolphindetailsviewexpander.cpp +++ b/src/dolphindetailsviewexpander.cpp @@ -45,19 +45,13 @@ DolphinDetailsViewExpander::DolphinDetailsViewExpander(DolphinDetailsView* paren m_dirLister = m_dolphinModel->dirLister(); Q_ASSERT(m_dirLister != 0); - if(!urlsToExpand.isEmpty()) { - // The URLs must be sorted. E.g. /home/user/ cannot be expanded before /home/ - // because it is not known to the dir model before. - m_urlsToExpand = urlsToExpand.toList(); - qSort(m_urlsToExpand); + // The URLs must be sorted. E.g. /home/user/ cannot be expanded before /home/ + // because it is not known to the dir model before. + m_urlsToExpand = urlsToExpand.toList(); + qSort(m_urlsToExpand); - // The dir lister must have completed the folder listing before a subfolder can be expanded. - connect(m_dirLister, SIGNAL(completed()), this, SLOT(slotDirListerCompleted())); - } - else { - // There is nothing to expand - destroy this object - deleteLater(); - } + // The dir lister must have completed the folder listing before a subfolder can be expanded. + connect(m_dirLister, SIGNAL(completed()), this, SLOT(slotDirListerCompleted())); } DolphinDetailsViewExpander::~DolphinDetailsViewExpander() @@ -86,8 +80,7 @@ void DolphinDetailsViewExpander::slotDirListerCompleted() const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex); m_detailsView->expand(proxyIndex); } - - if(m_urlsToExpand.isEmpty()) { + else { emit completed(); stop(); } diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index a2689b8c8..3911b92bd 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -1209,8 +1209,6 @@ void DolphinView::loadDirectory(const KUrl& url, bool reload) return; } - m_expanderActive = false; - KDirLister* dirLister = m_viewAccessor.dirLister(); dirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags); |
