┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-03-10 21:58:55 +0000
committerPeter Penz <[email protected]>2007-03-10 21:58:55 +0000
commitfca6867fea49edb4134332562f518ddddd3fc2a1 (patch)
treed7ed5d1ae9e14f1002c357380be23a4fa029ac1d /src/dolphinmainwindow.cpp
parent175f629b699cad7845cc720815c0aa4b56846553 (diff)
Apply an item effect to all cut items. As discussed with Fredrik this should be done in the application itself and not inside KDirModel to be able to do some optimizations.
svn path=/trunk/KDE/kdebase/apps/; revision=641317
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 6e2517344..e0a0a5633 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -528,11 +528,32 @@ void DolphinMainWindow::undo()
void DolphinMainWindow::cut()
{
+ QClipboard* clipboard = QApplication::clipboard();
+ const QMimeData* currentMimeData = clipboard->mimeData();
+ const bool hadCutSelection = KonqMimeData::decodeIsCutSelection(currentMimeData);
+
QMimeData* mimeData = new QMimeData();
const KUrl::List kdeUrls = m_activeView->selectedUrls();
const KUrl::List mostLocalUrls;
KonqMimeData::populateMimeData(mimeData, kdeUrls, mostLocalUrls, true);
QApplication::clipboard()->setMimeData(mimeData);
+
+ if (hadCutSelection) {
+ // If an old cut selection has been applied, the view must
+ // be reloaded to get the original icons of the items without an
+ // applied item effect.
+ m_view[PrimaryIdx]->reload();
+ if (m_view[SecondaryIdx] != 0) {
+ m_view[SecondaryIdx]->reload();
+ }
+ }
+ else {
+ // apply an item effect for the icons of all cut items
+ m_view[PrimaryIdx]->updateCutItems();
+ if (m_view[SecondaryIdx] != 0) {
+ m_view[SecondaryIdx]->updateCutItems();
+ }
+ }
}
void DolphinMainWindow::copy()