diff options
Diffstat (limited to 'src/modinfodialogimages.cpp')
| -rw-r--r-- | src/modinfodialogimages.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/modinfodialogimages.cpp b/src/modinfodialogimages.cpp index 1f5b258c..4acc7838 100644 --- a/src/modinfodialogimages.cpp +++ b/src/modinfodialogimages.cpp @@ -140,6 +140,18 @@ ImagesTab::ImagesTab( ui->imagesScrollArea->setWidgetResizable(false); ui->imagesScrollArea->setTab(this); ui->imagesThumbnails->setTab(this); + + const auto list = QImageReader::supportedImageFormats(); + for (const auto& entry : list) { + QString s(entry); + if (!s.isEmpty()) { + if (s[0] != ".") { + s = "." + s; + } + + m_supportedFormats.emplace_back(std::move(s)); + } + } } void ImagesTab::clear() @@ -151,10 +163,11 @@ void ImagesTab::clear() bool ImagesTab::feedFile(const QString& rootPath, const QString& fullPath) { - QImageReader reader(fullPath); - if (reader.canRead()) { - m_files.push_back({fullPath}); - return true; + for (const auto& ext : m_supportedFormats) { + if (fullPath.endsWith(ext, Qt::CaseInsensitive)) { + m_files.push_back({fullPath}); + return true; + } } return false; |
