X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c848b945d44b3621d6418e6589ea5792003fa3c9..950d61feda059bddf11ef5549077c3bd02b4e6a5:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 5cea1bde0..8278d136a 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -67,8 +67,6 @@ #include "viewproperties.h" #include "zoomlevelinfo.h" -#include - /** * Helper function for sorting items with qSort() in * DolphinView::renameSelectedItems(). @@ -106,7 +104,7 @@ DolphinView::DolphinView(QWidget* parent, m_previewGenerator(0), m_toolTipManager(0), m_rootUrl(), - m_currentItemUrl(), + m_activeItemUrl(), m_createdItemUrl(), m_selectedItems(), m_newFileNames(), @@ -610,9 +608,6 @@ QString DolphinView::statusBarText() const void DolphinView::setUrl(const KUrl& url) { m_newFileNames.clear(); - - // remember current item candidate (see slotDirListerCompleted()) - m_currentItemUrl = url; updateView(url, KUrl()); } @@ -1102,6 +1097,11 @@ bool DolphinView::isTabsForFilesEnabled() const return m_tabsForFiles; } +void DolphinView::activateItem(const KUrl& url) +{ + m_activeItemUrl = url; +} + bool DolphinView::itemsExpandable() const { return (m_detailsView != 0) && m_detailsView->itemsExpandable(); @@ -1193,9 +1193,9 @@ void DolphinView::slotRequestUrlChange(const KUrl& url) void DolphinView::slotDirListerCompleted() { - if (!m_currentItemUrl.isEmpty()) { + if (!m_activeItemUrl.isEmpty()) { // assure that the current item remains visible - const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_currentItemUrl); + const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_activeItemUrl); if (dirIndex.isValid()) { const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex); QAbstractItemView* view = itemView(); @@ -1204,8 +1204,8 @@ void DolphinView::slotDirListerCompleted() if (clearSelection) { view->clearSelection(); } + m_activeItemUrl.clear(); } - m_currentItemUrl.clear(); } if (!m_newFileNames.isEmpty()) {