Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaked missing image format warning #994

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"<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(", ")));
call_error("Missing image formats: <b>" + expected_formats.join(", ") + "</b>.<br /><br /> Please make sure you have installed the application properly.");
}

QString p_language = Options::getInstance().language();
Expand Down