makes it possible to restore the expanded folders in the Details View
when navigating in history (based on r1056438 and r1079843).
Also remove DolphinView::activateItem(const KUrl&) and DolphinView's
m_loadingDirectory member (they are not needed any more).
This will be in KDE 4.5.
BUG: 169886
svn path=/trunk/KDE/kdebase/apps/; revision=
1080549
QWidget(parent),
m_active(true),
m_showPreview(false),
- m_loadingDirectory(false),
m_storedCategorizedSorting(false),
m_tabsForFiles(false),
m_isContextMenuOpen(false),
return m_tabsForFiles;
}
-void DolphinView::activateItem(const KUrl& url)
-{
- // TODO: If DolphinViewContainer uses DolphinView::restoreState(...) to restore the
- // view state in KDE 4.5, this function can be removed.
- m_activeItemUrl = url;
-}
-
bool DolphinView::itemsExpandable() const
{
return m_viewAccessor.itemsExpandable();
void DolphinView::slotLoadingCompleted()
{
m_expanderActive = false;
- m_loadingDirectory = false;
if (!m_activeItemUrl.isEmpty()) {
// assure that the current item remains visible
return;
}
- m_loadingDirectory = true;
m_expanderActive = false;
KDirLister* dirLister = m_viewAccessor.dirLister();
if (m_columnsContainer != 0) {
m_columnsContainer->showColumn(url);
}
-
- if(!m_detailsViewExpander.isNull()) {
- // stop expanding items in the current folder
- m_detailsViewExpander->stop();
- }
}
QAbstractItemView* DolphinView::ViewAccessor::itemView() const
const DolphinDetailsViewExpander* DolphinView::ViewAccessor::setExpandedUrls(const QSet<KUrl>& urlsToExpand)
{
if ((m_detailsView != 0) && m_detailsView->itemsExpandable() && !urlsToExpand.isEmpty()) {
+ // Check if another expander is already active and stop it if necessary.
+ if(!m_detailsViewExpander.isNull()) {
+ m_detailsViewExpander->stop();
+ }
+
m_detailsViewExpander = new DolphinDetailsViewExpander(m_detailsView, urlsToExpand);
return m_detailsViewExpander;
}
Q_ASSERT(view != 0);
view->horizontalScrollBar()->setValue(x);
view->verticalScrollBar()->setValue(y);
-
- m_loadingDirectory = false;
}
}
void setTabsForFilesEnabled(bool tabsForFiles);
bool isTabsForFilesEnabled() const;
- /**
- * Marks the item \a url as active item as soon as it has
- * been loaded by the directory lister. This is useful mark
- * the previously visited directory as active when going
- * back in history (the URL is known, but the item is not
- * loaded yet).
- */
- void activateItem(const KUrl& url);
-
/**
* Returns true if the current view allows folders to be expanded,
* i.e. presents a hierarchical view to the user.
bool m_active : 1;
bool m_showPreview : 1;
- bool m_loadingDirectory : 1;
bool m_storedCategorizedSorting : 1;
bool m_tabsForFiles : 1;
bool m_isContextMenuOpen : 1; // TODO: workaround for Qt-issue 207192
} else {
updateStatusBar();
}
- QMetaObject::invokeMethod(this, "restoreViewState", Qt::QueuedConnection);
// Enable the 'File'->'Create New...' menu only if the directory
// supports writing.
delayedStatusBarUpdate();
}
-void DolphinViewContainer::restoreViewState()
-{
- QByteArray locationState = m_urlNavigator->locationState();
- QDataStream stream(&locationState, QIODevice::ReadOnly);
- m_view->restoreState(stream);
-}
-
void DolphinViewContainer::activate()
{
setActive(true);
void DolphinViewContainer::slotHistoryChanged()
{
- const int index = m_urlNavigator->historyIndex();
- if (index > 0) {
- // The "Go Forward" action is enabled. Try to mark
- // the previous directory as active item:
- const KUrl url = m_urlNavigator->locationUrl(index - 1);
- m_view->activateItem(url);
+ QByteArray locationState = m_urlNavigator->locationState();
+
+ if (!locationState.isEmpty()) {
+ QDataStream stream(&locationState, QIODevice::ReadOnly);
+ m_view->restoreState(stream);
}
}
*/
void setNameFilter(const QString& nameFilter);
- void restoreViewState();
-
/**
* Marks the view container as active
* (see DolphinViewContainer::setActive()).