summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Reininghaus <frank78ac@googlemail.com>2012-03-27 17:48:49 (GMT)
committerFrank Reininghaus <frank78ac@googlemail.com>2012-03-27 17:48:49 (GMT)
commit210e5e3b96883f5d856913f81834310ecb3819bf (patch)
treed9fed1e0b1fac76dee2083b9aead4375d20b1f50
parentfdf6c1d161ee20b0343e72a3dbcbb56bd1c7d9cc (diff)
Select files which have been pasted or dropped
Also clear the previous selection. BUG: 295389 FIXED-IN: 4.8.2
-rw-r--r--dolphin/src/views/dolphinview.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/dolphin/src/views/dolphinview.cpp b/dolphin/src/views/dolphinview.cpp
index 37a1ea3..38afd6e 100644
--- a/dolphin/src/views/dolphinview.cpp
+++ b/dolphin/src/views/dolphinview.cpp
@@ -870,6 +870,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)
@@ -1058,6 +1063,8 @@ void DolphinView::updateViewState()
}
if (!m_selectedUrls.isEmpty()) {
+ clearSelection();
+
KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager();
QSet<int> selectedItems = selectionManager->selectedItems();
const KFileItemModel* model = fileItemModel();
@@ -1335,8 +1342,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()