Store database icons as QImage instead of QIcon.

This has the advantage that they can be used without a running X server.
Add methods to retrieve QPixmaps that are converted from the stored QImages
and cached by QPixmapCache.
This commit is contained in:
Felix Geyer committed 2012-01-01 21:52:54 +01:00
1 parent fdf600e09a
commit 00aafa69f5
15 files changed
+137 -60

No files matched your search

+3 -3
View File
@@ -120,12 +120,12 @@ bool Metadata::autoEnableVisualHiding() const
return m_autoEnableVisualHiding;
}
QIcon Metadata::customIcon(const Uuid& uuid) const
QImage Metadata::customIcon(const Uuid& uuid) const
{
return m_customIcons.value(uuid);
}
QHash<Uuid, QIcon> Metadata::customIcons() const
QHash<Uuid, QImage> Metadata::customIcons() const
{
return m_customIcons;
}
@@ -257,7 +257,7 @@ void Metadata::setAutoEnableVisualHiding(bool value)
m_autoEnableVisualHiding = value;
}
void Metadata::addCustomIcon(const Uuid& uuid, const QIcon& icon)
void Metadata::addCustomIcon(const Uuid& uuid, const QImage& icon)
{
Q_ASSERT(!uuid.isNull());
Q_ASSERT(!m_customIcons.contains(uuid));