┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-03-27 19:48:49 +0200
committerFrank Reininghaus <[email protected]>2012-03-27 19:52:04 +0200
commit88c3bd18663c8ceaf418e4b6d247ba6bd83e47ff (patch)
tree980aa00286ccc69c79ed6383b9a7a8ce5ead7c18 /src
parent793311dac163592a8b63fc4859fdc054d7a22022 (diff)
Select files which have been pasted or dropped
Also clear the previous selection. CCBUG: 295389 (cherry picked from commit 210e5e3b96883f5d856913f81834310ecb3819bf)
Diffstat (limited to 'src')
-rw-r--r--src/views/dolphinview.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index c9af2248a..ab81316e1 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -942,6 +942,11 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
if (!error.isEmpty()) {
emit errorMessage(error);
}
+
+ if (destUrl == url()) {
+ // Mark the dropped urls as selected.
+ markPastedUrlsAsSelected(event->mimeData());
+ }
}
void DolphinView::slotModelChanged(KItemModelBase* current, KItemModelBase* previous)
@@ -1146,6 +1151,8 @@ void DolphinView::updateViewState()
}
if (!m_selectedUrls.isEmpty()) {
+ clearSelection();
+
KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager();
QSet<int> selectedItems = selectionManager->selectedItems();
const KFileItemModel* model = fileItemModel();
@@ -1417,8 +1424,13 @@ QMimeData* DolphinView::selectionMimeData() const
void DolphinView::markPastedUrlsAsSelected(const QMimeData* mimeData)
{
- const KUrl::List urls = KUrl::List::fromMimeData(mimeData);
- markUrlsAsSelected(urls);
+ const KUrl::List sourceUrls = KUrl::List::fromMimeData(mimeData);
+ KUrl::List destUrls;
+ foreach (const KUrl& source, sourceUrls) {
+ KUrl destination(url().url() + "/" + source.fileName());
+ destUrls << destination;
+ }
+ markUrlsAsSelected(destUrls);
}
void DolphinView::updateWritableState()