diff options
Diffstat (limited to 'api/gui/icons')
-rw-r--r-- | api/gui/icons/IconList.cpp | 11 | ||||
-rw-r--r-- | api/gui/icons/IconList.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/api/gui/icons/IconList.cpp b/api/gui/icons/IconList.cpp index 5c2c1386..997a03db 100644 --- a/api/gui/icons/IconList.cpp +++ b/api/gui/icons/IconList.cpp @@ -269,6 +269,17 @@ void IconList::installIcons(const QStringList &iconFiles) } } +void IconList::installIcon(const QString &file, const QString &name) +{ + QFileInfo fileinfo(file); + if(!fileinfo.isReadable() || !fileinfo.isFile()) + return; + + QString target = FS::PathCombine(m_dir.dirName(), name); + + QFile::copy(file, target); +} + bool IconList::iconFileExists(const QString &key) const { auto iconEntry = icon(key); diff --git a/api/gui/icons/IconList.h b/api/gui/icons/IconList.h index b8599103..fad3336f 100644 --- a/api/gui/icons/IconList.h +++ b/api/gui/icons/IconList.h @@ -56,6 +56,7 @@ public: virtual Qt::ItemFlags flags(const QModelIndex &index) const override; void installIcons(const QStringList &iconFiles) override; + void installIcon(const QString &file, const QString &name) override; const MMCIcon * icon(const QString &key) const; |