From: Frank Reininghaus Date: Mon, 19 Nov 2012 21:06:29 +0000 (+0100) Subject: Clear the previous selection when selecting pasted or dropped items X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/ba3e70ffe075bfee6cf172b4f0405709f1ad1200 Clear the previous selection when selecting pasted or dropped items This fixes a recent regression in the 4.9 branch caused by b25059e803e7eed54f0593605a4066882d63bce2. BUG: 310365 FIXED-IN: 4.9.4 REVIEW: 107389 --- diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 13db9896e..70a739427 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -101,6 +101,7 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) : m_scrollToCurrentItem(false), m_restoredContentsPosition(), m_selectedUrls(), + m_clearSelectionBeforeSelectingNewItems(false), m_versionControlObserver(0) { m_topLayout = new QVBoxLayout(this); @@ -1218,6 +1219,12 @@ void DolphinView::updateViewState() if (!m_selectedUrls.isEmpty()) { KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager(); + + if (m_clearSelectionBeforeSelectingNewItems) { + selectionManager->clearSelection(); + m_clearSelectionBeforeSelectingNewItems = false; + } + QSet selectedItems = selectionManager->selectedItems(); for (QList::iterator it = m_selectedUrls.begin(); it != m_selectedUrls.end(); ++it) { @@ -1535,6 +1542,7 @@ void DolphinView::markPastedUrlsAsSelected(const QMimeData* mimeData) destUrls << destination; } markUrlsAsSelected(destUrls); + m_clearSelectionBeforeSelectingNewItems = true; } void DolphinView::updateWritableState() diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 7d8e8b76a..f756de05e 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -759,6 +759,7 @@ private: QPoint m_restoredContentsPosition; QList m_selectedUrls; // Used for making the view to remember selections after F5 + bool m_clearSelectionBeforeSelectingNewItems; VersionControlObserver* m_versionControlObserver;