mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-04 07:42:35 -08:00
Move pixmap caching to Metadata.
This commit is contained in:
1 parent
2d741afe3e
commit
4752adf9d3
6 files changed
+36
-23
No files matched your search
+5
-10
@@ -114,13 +114,12 @@ QPixmap Entry::iconPixmap() const
|
||||
else {
|
||||
Q_ASSERT(database());
|
||||
|
||||
QPixmap pixmap;
|
||||
if (database() && !QPixmapCache::find(m_pixmapCacheKey, &pixmap)) {
|
||||
pixmap = QPixmap::fromImage(database()->metadata()->customIcon(m_data.customIcon));
|
||||
m_pixmapCacheKey = QPixmapCache::insert(pixmap);
|
||||
if (database()) {
|
||||
return database()->metadata()->customIconPixmap(m_data.customIcon);
|
||||
}
|
||||
else {
|
||||
return QPixmap();
|
||||
}
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,8 +247,6 @@ void Entry::setIcon(int iconNumber)
|
||||
m_data.iconNumber = iconNumber;
|
||||
m_data.customIcon = Uuid();
|
||||
|
||||
m_pixmapCacheKey = QPixmapCache::Key();
|
||||
|
||||
Q_EMIT modified();
|
||||
emitDataChanged();
|
||||
}
|
||||
@@ -263,8 +260,6 @@ void Entry::setIcon(const Uuid& uuid)
|
||||
m_data.customIcon = uuid;
|
||||
m_data.iconNumber = 0;
|
||||
|
||||
m_pixmapCacheKey = QPixmapCache::Key();
|
||||
|
||||
Q_EMIT modified();
|
||||
emitDataChanged();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user