GH-1031 include icon in exported instance if it is custom

This commit is contained in:
Petr Mrázek
2015-06-01 01:19:12 +02:00
parent 96c497f654
commit 405cea1778
6 changed files with 92 additions and 7 deletions

View File

@ -261,6 +261,24 @@ void IconList::installIcons(QStringList iconFiles)
}
}
bool IconList::iconFileExists(QString key)
{
auto iconEntry = icon(key);
if(!iconEntry)
{
return false;
}
return iconEntry->has(MMCIcon::FileBased);
}
const MMCIcon *IconList::icon(QString key)
{
int iconIdx = getIconIndex(key);
if (iconIdx == -1)
return nullptr;
return &icons[iconIdx];
}
bool IconList::deleteIcon(QString key)
{
int iconIdx = getIconIndex(key);

View File

@ -43,6 +43,7 @@ public:
bool addIcon(QString key, QString name, QString path, MMCIcon::Type type);
bool deleteIcon(QString key);
bool iconFileExists(QString key);
virtual QStringList mimeTypes() const;
virtual Qt::DropActions supportedDropActions() const;
@ -52,6 +53,8 @@ public:
void installIcons(QStringList iconFiles);
const MMCIcon * icon(QString key);
void startWatching();
void stopWatching();