fix: playlist filter should consider plugins

setAutoLoadFilterSuffix with formats dynammically got from QImageReader, fix https://github.com/BLumia/pineapple-pictures/issues/120
This commit is contained in:
zhongyic00 2024-07-18 16:01:07 +00:00 committed by Gary Wang
parent ae257ea567
commit d01297043e

View File

@ -33,6 +33,7 @@
#include <QTimer> #include <QTimer>
#include <QFileDialog> #include <QFileDialog>
#include <QStandardPaths> #include <QStandardPaths>
#include <QStringBuilder>
#include <QProcess> #include <QProcess>
#include <QDesktopServices> #include <QDesktopServices>
#include <QMessageBox> #include <QMessageBox>
@ -56,11 +57,12 @@ MainWindow::MainWindow(QWidget *parent)
this->setWindowIcon(QIcon(":/icons/app-icon.svg")); this->setWindowIcon(QIcon(":/icons/app-icon.svg"));
this->setMouseTracking(true); this->setMouseTracking(true);
m_pm->setAutoLoadFilterSuffix({
"*.jpg", "*.jpeg", "*.jfif", QStringList formatFilters;
"*.png", "*.gif", "*.svg", "*.bmp", "*.webp", for (const QByteArray &item : QImageReader::supportedImageFormats()) {
"*.tif", "*.tiff" formatFilters.append(QStringLiteral("*.") % QString::fromLocal8Bit(item));
}); }
m_pm->setAutoLoadFilterSuffix(formatFilters);
m_fadeOutAnimation = new QPropertyAnimation(this, "windowOpacity"); m_fadeOutAnimation = new QPropertyAnimation(this, "windowOpacity");
m_fadeOutAnimation->setDuration(300); m_fadeOutAnimation->setDuration(300);