mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
const_cast "this" instead of the member variable.
This commit is contained in:
parent
b6d9c2e486
commit
0c1fecfb2b
@ -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<QPixmapCache::Key*>(&m_pixmapCacheKey) = QPixmapCache::insert(pixmap);
|
||||
const_cast<Entry*>(this)->m_pixmapCacheKey = QPixmapCache::insert(pixmap);
|
||||
}
|
||||
|
||||
return pixmap;
|
||||
|
@ -37,6 +37,8 @@ Group::~Group()
|
||||
{
|
||||
cleanupParent();
|
||||
this->blockSignals(true);
|
||||
// Destroy entries and children manually so DeletedObjects can be added
|
||||
// to database.
|
||||
if (m_db && m_parent) {
|
||||
QList<Entry*> entries = m_entries;
|
||||
Q_FOREACH (Entry* entry, entries) {
|
||||
@ -118,7 +120,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<QPixmapCache::Key*>(&m_pixmapCacheKey) = QPixmapCache::insert(pixmap);
|
||||
const_cast<Group*>(this)->m_pixmapCacheKey = QPixmapCache::insert(pixmap);
|
||||
}
|
||||
|
||||
return pixmap;
|
||||
|
Loading…
Reference in New Issue
Block a user