diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index 08186c0f..f0f65a93 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -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(this)->m_pixmapCacheKey = QPixmapCache::insert(pixmap); + m_pixmapCacheKey = QPixmapCache::insert(pixmap); } return pixmap; diff --git a/src/core/Entry.h b/src/core/Entry.h index c629e362..34510294 100644 --- a/src/core/Entry.h +++ b/src/core/Entry.h @@ -154,7 +154,7 @@ private: Entry* m_tmpHistoryItem; bool m_modifiedSinceBegin; QPointer m_group; - QPixmapCache::Key m_pixmapCacheKey; + mutable QPixmapCache::Key m_pixmapCacheKey; bool m_updateTimeinfo; }; diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 0f154c02..cde72425 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -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(this)->m_pixmapCacheKey = QPixmapCache::insert(pixmap); + m_pixmapCacheKey = QPixmapCache::insert(pixmap); } return pixmap; diff --git a/src/core/Group.h b/src/core/Group.h index 1ca543d9..5ed2b293 100644 --- a/src/core/Group.h +++ b/src/core/Group.h @@ -141,7 +141,7 @@ private: QList m_entries; QPointer m_parent; - QPixmapCache::Key m_pixmapCacheKey; + mutable QPixmapCache::Key m_pixmapCacheKey; bool m_updateTimeinfo;