From fca6867fea49edb4134332562f518ddddd3fc2a1 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 10 Mar 2007 21:58:55 +0000 Subject: 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 --- src/dolphinmainwindow.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/dolphinmainwindow.cpp') 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() -- cgit v1.3