┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-11-19 22:06:29 +0100
committerFrank Reininghaus <[email protected]>2012-11-24 16:04:43 +0100
commitba3e70ffe075bfee6cf172b4f0405709f1ad1200 (patch)
tree6cfb1cf0caadaac398a49013c07fec9b29ecfb91 /src
parent2099f4a0c5d36fda8d20c54a5b001dacebe0e6db (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/views/dolphinview.cpp8
-rw-r--r--src/views/dolphinview.h1
2 files changed, 9 insertions, 0 deletions
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<int> selectedItems = selectionManager->selectedItems();
for (QList<KUrl>::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<KUrl> m_selectedUrls; // Used for making the view to remember selections after F5
+ bool m_clearSelectionBeforeSelectingNewItems;
VersionControlObserver* m_versionControlObserver;