diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-10-03 00:55:54 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-10-26 18:21:24 +0200 |
commit | d66fdcd4cc6913508d2987c14cd9fc4d6760b8a5 (patch) | |
tree | 4f385106ce732d4f7338feab5391f2a06c68a0e6 /api/gui/icons | |
parent | bbe139dce51a7965394c800cac974946820d3869 (diff) | |
download | MultiMC-d66fdcd4cc6913508d2987c14cd9fc4d6760b8a5.tar MultiMC-d66fdcd4cc6913508d2987c14cd9fc4d6760b8a5.tar.gz MultiMC-d66fdcd4cc6913508d2987c14cd9fc4d6760b8a5.tar.lz MultiMC-d66fdcd4cc6913508d2987c14cd9fc4d6760b8a5.tar.xz MultiMC-d66fdcd4cc6913508d2987c14cd9fc4d6760b8a5.zip |
NOISSUE Granular instance reload
Diffstat (limited to 'api/gui/icons')
-rw-r--r-- | api/gui/icons/IconList.cpp | 8 | ||||
-rw-r--r-- | api/gui/icons/IconList.h | 11 |
2 files changed, 10 insertions, 9 deletions
diff --git a/api/gui/icons/IconList.cpp b/api/gui/icons/IconList.cpp index 4f9fb09f..b6be007f 100644 --- a/api/gui/icons/IconList.cpp +++ b/api/gui/icons/IconList.cpp @@ -243,7 +243,7 @@ int IconList::rowCount(const QModelIndex &parent) const return icons.size(); } -void IconList::installIcons(QStringList iconFiles) +void IconList::installIcons(const QStringList &iconFiles) { for (QString file : iconFiles) { @@ -261,7 +261,7 @@ void IconList::installIcons(QStringList iconFiles) } } -bool IconList::iconFileExists(QString key) +bool IconList::iconFileExists(const QString &key) const { auto iconEntry = icon(key); if(!iconEntry) @@ -271,7 +271,7 @@ bool IconList::iconFileExists(QString key) return iconEntry->has(IconType::FileBased); } -const MMCIcon *IconList::icon(QString key) +const MMCIcon *IconList::icon(const QString &key) const { int iconIdx = getIconIndex(key); if (iconIdx == -1) @@ -279,7 +279,7 @@ const MMCIcon *IconList::icon(QString key) return &icons[iconIdx]; } -bool IconList::deleteIcon(QString key) +bool IconList::deleteIcon(const QString &key) { int iconIdx = getIconIndex(key); if (iconIdx == -1) diff --git a/api/gui/icons/IconList.h b/api/gui/icons/IconList.h index 7aeb7067..24ff4454 100644 --- a/api/gui/icons/IconList.h +++ b/api/gui/icons/IconList.h @@ -44,18 +44,19 @@ public: virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; - virtual bool addIcon(QString key, QString name, QString path, IconType type) override; - bool deleteIcon(QString key); - bool iconFileExists(QString key); + bool addIcon(const QString &key, const QString &name, const QString &path, const IconType type) override; + void saveIcon(const QString &key, const QString &path, const char * format) const override; + bool deleteIcon(const QString &key) override; + bool iconFileExists(const QString &key) const override; virtual QStringList mimeTypes() const override; virtual Qt::DropActions supportedDropActions() const override; virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; virtual Qt::ItemFlags flags(const QModelIndex &index) const override; - void installIcons(QStringList iconFiles); + void installIcons(const QStringList &iconFiles) override; - const MMCIcon * icon(QString key); + const MMCIcon * icon(const QString &key) const; void startWatching(); void stopWatching(); |