Commit 4e63fa5d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix generate file filter

parent f1eb2759
...@@ -215,12 +215,17 @@ void XFaceConfigurator::setXfaceFromFile(const QUrl &url) ...@@ -215,12 +215,17 @@ void XFaceConfigurator::setXfaceFromFile(const QUrl &url)
void XFaceConfigurator::slotSelectFile() void XFaceConfigurator::slotSelectFile()
{ {
const QList<QByteArray> mimeTypes = QImageReader::supportedImageFormats();
QString filter; QString filter;
for (const QByteArray &mime : mimeTypes) { const QList<QByteArray> supportedImage = QImageReader::supportedImageFormats();
filter += QString::fromLatin1(mime); for (const QByteArray &ba : supportedImage) {
if (!filter.isEmpty()) {
filter += QLatin1Char(' ');
}
filter += QLatin1String("*.") + QString::fromLatin1(ba);
} }
const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), i18n("Image (%1)", filter));
filter = QStringLiteral("%1 (%2)").arg(i18n("Image"), filter);
const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), filter);
if (!url.isEmpty()) { if (!url.isEmpty()) {
setXfaceFromFile(url); setXfaceFromFile(url);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment