Tweaked missing image format warning (#994)

* Tweaked missing image format warning

* Tweaked code format

* run clang-format

---------

Co-authored-by: stonedDiscord <Tukz@gmx.de>
This commit is contained in:
Leifa 2024-07-01 18:49:15 +02:00 committed by GitHub
parent 36345612d7
commit 1a7884a726
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,19 +45,18 @@ int main(int argc, char *argv[])
fontDatabase.addApplicationFont(it.next()); fontDatabase.addApplicationFont(it.next());
} }
QStringList missing_formats{"webp", "apng", "gif"}; QStringList expected_formats{"webp", "apng", "gif"};
for (const QByteArray &i_format : QImageReader::supportedImageFormats()) for (const QByteArray &i_format : QImageReader::supportedImageFormats())
{ {
missing_formats.removeAll(i_format.toLower()); if (expected_formats.contains(i_format, Qt::CaseInsensitive))
{
expected_formats.removeAll(i_format.toLower());
}
} }
if (!missing_formats.empty()) if (!expected_formats.isEmpty())
{ {
call_error(QString("Missing the following image formats: %1." call_error("Missing image formats: <b>" + expected_formats.join(", ") + "</b>.<br /><br /> Please make sure you have installed the application properly.");
"<br/>Please make sure the client is installed correctly."
"<br/>If you are on Linux, you may need to install your distribution's image formats package, "
"as detailed in the project's <a href='https://github.com/AttorneyOnline/AO2-Client'>README<a>.")
.arg(missing_formats.join(", ")));
} }
QString p_language = Options::getInstance().language(); QString p_language = Options::getInstance().language();