diff options
| author | Peter Penz <[email protected]> | 2010-01-14 07:43:14 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2010-01-14 07:43:14 +0000 |
| commit | d3ee535749d0c61b0361601badb6f74473580ad1 (patch) | |
| tree | 6162f3bed8af025b1ef1c12b1993cb5e9d59515b | |
| parent | a0d3cf4aa8ffa76ed22a67efa4ea156eb2ef9f68 (diff) | |
If the root directory lister is different from the internally used directory lister (e. g. in the column view), it is important to synchronize them.
This fixes the issue that the enabled state of the "Create New..." menu in the column view has not been updated.
BUG: 222329
svn path=/trunk/KDE/kdebase/apps/; revision=1074441
| -rw-r--r-- | src/dolphinview.cpp | 27 | ||||
| -rw-r--r-- | src/dolphinview.h | 1 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 606c5202d..688e8aa62 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -1269,7 +1269,16 @@ void DolphinView::loadDirectory(const KUrl& url, bool reload) m_loadingDirectory = true; m_expanderActive = false; - m_viewAccessor.dirLister()->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags); + KDirLister* dirLister = m_viewAccessor.dirLister(); + dirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags); + + KDirLister* rootDirLister = m_viewAccessor.rootDirLister(); + if (dirLister != rootDirLister) { + // In the case of the column view the root directory lister can be different. Assure + // that it gets synchronized (clients from DolphinView are not aware that internally + // different directory listers are used). + rootDirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags); + } } void DolphinView::applyViewProperties() @@ -1532,7 +1541,7 @@ void DolphinView::ViewAccessor::prepareUrlChange(const KUrl& url) } if(!m_detailsViewExpander.isNull()) { - // Stop expanding items in the current folder + // stop expanding items in the current folder m_detailsViewExpander->stop(); } } @@ -1572,6 +1581,11 @@ KUrl DolphinView::ViewAccessor::rootUrl() const return (m_columnsContainer != 0) ? m_columnsContainer->rootUrl() : KUrl(); } +KDirLister* DolphinView::ViewAccessor::rootDirLister() const +{ + return static_cast<DolphinModel*>(m_proxyModel->sourceModel())->dirLister(); +} + bool DolphinView::ViewAccessor::supportsCategorizedSorting() const { return m_iconsView != 0; @@ -1585,17 +1599,16 @@ bool DolphinView::ViewAccessor::itemsExpandable() const QSet<KUrl> DolphinView::ViewAccessor::expandedUrls() const { - if(m_detailsView != 0) { + if (m_detailsView != 0) { return m_detailsView->expandedUrls(); } - else { - return QSet<KUrl>(); - } + + return QSet<KUrl>(); } const DolphinDetailsViewExpander* DolphinView::ViewAccessor::setExpandedUrls(const QSet<KUrl>& urlsToExpand) { - if((m_detailsView != 0) && m_detailsView->itemsExpandable() && !urlsToExpand.isEmpty()) { + if ((m_detailsView != 0) && m_detailsView->itemsExpandable() && !urlsToExpand.isEmpty()) { m_detailsViewExpander = new DolphinDetailsViewExpander(m_detailsView, urlsToExpand); return m_detailsViewExpander; } diff --git a/src/dolphinview.h b/src/dolphinview.h index 95a2ad3b1..17f1395ac 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -804,6 +804,7 @@ private: QWidget* layoutTarget() const; KUrl rootUrl() const; + KDirLister* rootDirLister() const; bool supportsCategorizedSorting() const; bool itemsExpandable() const; |
