┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodelrolesupdater.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-03-21 12:08:59 +0100
committerPeter Penz <[email protected]>2012-03-21 12:12:35 +0100
commit982ce7ae203de9142ca3e79e6fdeacd003fb0414 (patch)
tree76537d71ae5c06cfddbcde9b772756ef81fcb4b9 /src/kitemviews/kfileitemmodelrolesupdater.cpp
parentd3a2f1ba82de87dbc0f762263e4509d2d73f7fd0 (diff)
Prevent flickering when updating items
When downloading images from e.g. the camera-IO-slave the files will be downloaded as *.part files and renamed afterwards. The renaming results in an undetermined mimetype and hence the probably already available preview or icon gets replaced by a dummy icon. The patch fixes this by keeping the old values as long until they have been resolved by KFileItemModelRolesUpdater.
Diffstat (limited to 'src/kitemviews/kfileitemmodelrolesupdater.cpp')
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp
index 06749f993..7b0d75dba 100644
--- a/src/kitemviews/kfileitemmodelrolesupdater.cpp
+++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp
@@ -91,9 +91,9 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
// Use a timer to prevent that each call of slotItemsChanged() results in a synchronous
- // resolving of the roles. Postpone the resolving until no update has been done for 2 seconds.
+ // resolving of the roles. Postpone the resolving until no update has been done for 1 second.
m_changedItemsTimer = new QTimer(this);
- m_changedItemsTimer->setInterval(2000);
+ m_changedItemsTimer->setInterval(1000);
m_changedItemsTimer->setSingleShot(true);
connect(m_changedItemsTimer, SIGNAL(timeout()), this, SLOT(resolveChangedItems()));
}
@@ -418,6 +418,7 @@ void KFileItemModelRolesUpdater::resolveChangedItems()
itemRanges.append(KItemRange(index, 1));
}
}
+ m_changedItems.clear();
startUpdating(itemRanges);
}
@@ -711,7 +712,7 @@ bool KFileItemModelRolesUpdater::applyResolvedRoles(const KFileItem& item, Resol
data.insert("iconName", item.iconName());
if (m_clearPreviews) {
- data.insert("iconPixmap", QString());
+ data.insert("iconPixmap", QPixmap());
}
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),