Add SVG icon rendering/cache

This commit is contained in:
Petr Mrázek
2013-03-20 07:59:35 +01:00
parent 7d7e4034f4
commit e4806ab08d
6 changed files with 187 additions and 36 deletions

View File

@ -1,6 +1,7 @@
#include "instancemodel.h"
#include <instance.h>
#include <QIcon>
#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.