┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-05-29 20:01:13 +0000
committerPeter Penz <[email protected]>2008-05-29 20:01:13 +0000
commit8931e14eec50cd8a4693460839edfde8690ca297 (patch)
tree5c8c959a1671937cd208dd06f08617311e1c8be1
parent8d95c06df13717fe1e8dfd0d28dc0b8357e32064 (diff)
Before applying the cut item effect to a preview, assure that the cut items cache gets an update of the preview without effect. This assures that when cutting other items that the state of the previously cut items can be restored in any case.
svn path=/trunk/KDE/kdebase/apps/; revision=814273
-rw-r--r--src/iconmanager.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp
index 78bb89cf8..2a3827134 100644
--- a/src/iconmanager.cpp
+++ b/src/iconmanager.cpp
@@ -232,6 +232,20 @@ void IconManager::replaceIcon(const KUrl& url, const QPixmap& pixmap)
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
if (KonqMimeData::decodeIsCutSelection(mimeData) && isCutItem(item)) {
+ // Remember the current icon in the cache for cut items before
+ // the disabled effect is applied. This makes it possible restoring
+ // the uncut version again when cutting other items.
+ QList<ItemInfo>::iterator begin = m_cutItemsCache.begin();
+ QList<ItemInfo>::iterator end = m_cutItemsCache.end();
+ for (QList<ItemInfo>::iterator it = begin; it != end; ++it) {
+ if ((*it).url == item.url()) {
+ (*it).pixmap = icon;
+ break;
+ }
+ }
+
+ // apply the disabled effect to the icon for marking it as "cut item"
+ // and apply the icon to the item
KIconEffect iconEffect;
icon = iconEffect.apply(icon, KIconLoader::Desktop, KIconLoader::DisabledState);
m_dolphinModel->setData(idx, QIcon(icon), Qt::DecorationRole);