NOISSUE add svg instance icon support
This commit is contained in:
parent
fede712a26
commit
322922e013
@ -261,7 +261,7 @@ void IconList::installIcons(const QStringList &iconFiles)
|
|||||||
QString target = FS::PathCombine(m_dir.dirName(), fileinfo.fileName());
|
QString target = FS::PathCombine(m_dir.dirName(), fileinfo.fileName());
|
||||||
|
|
||||||
QString suffix = fileinfo.suffix();
|
QString suffix = fileinfo.suffix();
|
||||||
if (suffix != "jpeg" && suffix != "png" && suffix != "jpg" && suffix != "ico")
|
if (suffix != "jpeg" && suffix != "png" && suffix != "jpg" && suffix != "ico" && suffix != "svg")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!QFile::copy(file, target))
|
if (!QFile::copy(file, target))
|
||||||
@ -331,7 +331,7 @@ bool IconList::addIcon(const QString &key, const QString &name, const QString &p
|
|||||||
{
|
{
|
||||||
// replace the icon even? is the input valid?
|
// replace the icon even? is the input valid?
|
||||||
QIcon icon(path);
|
QIcon icon(path);
|
||||||
if (!icon.availableSizes().size())
|
if (icon.isNull())
|
||||||
return false;
|
return false;
|
||||||
auto iter = name_index.find(key);
|
auto iter = name_index.find(key);
|
||||||
if (iter != name_index.end())
|
if (iter != name_index.end())
|
||||||
|
@ -101,7 +101,7 @@ void IconPickerDialog::addNewIcon()
|
|||||||
QString selectIcons = tr("Select Icons");
|
QString selectIcons = tr("Select Icons");
|
||||||
//: The type of icon files
|
//: The type of icon files
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, selectIcons, QString(),
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, selectIcons, QString(),
|
||||||
tr("Icons") + "(*.png *.jpg *.jpeg *.ico)");
|
tr("Icons") + "(*.png *.jpg *.jpeg *.ico *.svg)");
|
||||||
MMC->icons()->installIcons(fileNames);
|
MMC->icons()->installIcons(fileNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user