mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 09:59:59 +03:00
Add SVG icon rendering/cache
This commit is contained in:
parent
7d7e4034f4
commit
e4806ab08d
6 changed files with 187 additions and 36 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue