From 1a7884a726cd95873490b311bcbe6af024d40586 Mon Sep 17 00:00:00 2001 From: Leifa <26681464+TrickyLeifa@users.noreply.github.com> Date: Mon, 1 Jul 2024 18:49:15 +0200 Subject: [PATCH] Tweaked missing image format warning (#994) * Tweaked missing image format warning * Tweaked code format * run clang-format --------- Co-authored-by: stonedDiscord --- src/main.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 65e5849..0cf0ad0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,19 +45,18 @@ int main(int argc, char *argv[]) fontDatabase.addApplicationFont(it.next()); } - QStringList missing_formats{"webp", "apng", "gif"}; + QStringList expected_formats{"webp", "apng", "gif"}; 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." - "
Please make sure the client is installed correctly." - "
If you are on Linux, you may need to install your distribution's image formats package, " - "as detailed in the project's README.") - .arg(missing_formats.join(", "))); + call_error("Missing image formats: " + expected_formats.join(", ") + ".

Please make sure you have installed the application properly."); } QString p_language = Options::getInstance().language();