Allow multiple image selections when adding favicons

This commit is contained in:
Jonathan White 2018-05-30 22:23:39 -04:00
parent 959acb7988
commit b07d4efe5f
No known key found for this signature in database
GPG Key ID: 440FC65F2E0C6E01

View File

@ -325,7 +325,8 @@ void EditWidgetIcons::addCustomIconFromFile()
if (m_database) {
QString filter = QString("%1 (%2);;%3 (*)").arg(tr("Images"), Tools::imageReaderFilter(), tr("All files"));
QString filename = QFileDialog::getOpenFileName(this, tr("Select Image"), "", filter);
auto filenames = QFileDialog::getOpenFileNames(this, tr("Select Image(s)"), "", filter);
for (const auto& filename : filenames) {
if (!filename.isEmpty()) {
auto icon = QImage(filename);
if (!icon.isNull()) {
@ -336,6 +337,7 @@ void EditWidgetIcons::addCustomIconFromFile()
}
}
}
}
void EditWidgetIcons::addCustomIcon(const QImage& icon)
{