Mark m_pixmapCacheKey as mutable so we don't have to const_cast.

This commit is contained in:
Felix Geyer 2012-07-25 12:15:14 +02:00
parent 6b13d18137
commit e9a96ff80a
4 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ QPixmap Entry::iconPixmap() const
if (!QPixmapCache::find(m_pixmapCacheKey, &pixmap)) {
// TODO: check if database() is 0
pixmap = QPixmap::fromImage(database()->metadata()->customIcon(m_data.customIcon));
const_cast<Entry*>(this)->m_pixmapCacheKey = QPixmapCache::insert(pixmap);
m_pixmapCacheKey = QPixmapCache::insert(pixmap);
}
return pixmap;

View File

@ -154,7 +154,7 @@ private:
Entry* m_tmpHistoryItem;
bool m_modifiedSinceBegin;
QPointer<Group> m_group;
QPixmapCache::Key m_pixmapCacheKey;
mutable QPixmapCache::Key m_pixmapCacheKey;
bool m_updateTimeinfo;
};

View File

@ -132,7 +132,7 @@ QPixmap Group::iconPixmap() const
if (!QPixmapCache::find(m_pixmapCacheKey, &pixmap)) {
// TODO: check if m_db is 0
pixmap = QPixmap::fromImage(m_db->metadata()->customIcon(m_customIcon));
const_cast<Group*>(this)->m_pixmapCacheKey = QPixmapCache::insert(pixmap);
m_pixmapCacheKey = QPixmapCache::insert(pixmap);
}
return pixmap;

View File

@ -141,7 +141,7 @@ private:
QList<Entry*> m_entries;
QPointer<Group> m_parent;
QPixmapCache::Key m_pixmapCacheKey;
mutable QPixmapCache::Key m_pixmapCacheKey;
bool m_updateTimeinfo;