From e4806ab08d0293d395c1718ab16d28ba2ae9d0ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 20 Mar 2013 07:59:35 +0100 Subject: Add SVG icon rendering/cache --- gui/instancemodel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gui/instancemodel.cpp') diff --git a/gui/instancemodel.cpp b/gui/instancemodel.cpp index 3c96c8f0..8db985e8 100644 --- a/gui/instancemodel.cpp +++ b/gui/instancemodel.cpp @@ -1,6 +1,7 @@ #include "instancemodel.h" #include #include +#include "iconcache.h" InstanceModel::InstanceModel ( const InstanceList& instances, QObject *parent ) : QAbstractListModel ( parent ), m_instances ( &instances ) @@ -70,11 +71,15 @@ QVariant InstanceModel::data ( const QModelIndex& index, int role ) const } case Qt::DecorationRole: { + IconCache * ic = IconCache::instance(); // FIXME: replace with an icon cache/renderer + /* QString path = ":/icons/instances/"; path += pdata->iconKey(); QIcon icon(path); - return icon; + */ + QString key = pdata->iconKey(); + return ic->getIcon(key); //else return QIcon(":/icons/multimc/scalable/apps/multimc.svg"); } // for now. -- cgit v1.2.3