diff options
| author | Leifa <26681464+TrickyLeifa@users.noreply.github.com> | 2024-06-30 23:19:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-30 23:19:02 +0200 |
| commit | c1f120adfb7dfc82f173826383a3a8064d5f8dc1 (patch) | |
| tree | 1f8008a8ce5ea9ad85fd70e549cefeadd5126f58 | |
| parent | 6488b181af67404d13a8dc2ba90b4c8bd0672b66 (diff) | |
| parent | a289d8c576f319392b98acd32bf5f032e55787df (diff) | |
Merge pull request #993 from lambdcalculus/master
Fix incorrect error messages due to QPluginLoader
| -rw-r--r-- | src/main.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index 955b1fff..65e58490 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,8 +8,8 @@ #include <QDebug> #include <QDirIterator> +#include <QImageReader> #include <QLibraryInfo> -#include <QPluginLoader> #include <QResource> #include <QTranslator> @@ -28,7 +28,6 @@ int main(int argc, char *argv[]) } #endif - AOApplication::addLibraryPath(AOApplication::applicationDirPath() + "/lib"); QResource::registerResource(main_app.get_asset("themes/" + Options::getInstance().theme() + ".rcc")); QFont main_font = main_app.font(); @@ -46,16 +45,19 @@ int main(int argc, char *argv[]) fontDatabase.addApplicationFont(it.next()); } - QPluginLoader apngPlugin("qapng"); - if (!apngPlugin.load()) + QStringList missing_formats{"webp", "apng", "gif"}; + for (const QByteArray &i_format : QImageReader::supportedImageFormats()) { - qCritical() << "QApng plugin could not be loaded"; + missing_formats.removeAll(i_format.toLower()); } - QPluginLoader webpPlugin("qwebp"); - if (!webpPlugin.load()) + if (!missing_formats.empty()) { - qCritical() << "QWebp plugin could not be loaded"; + 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(", "))); } QString p_language = Options::getInstance().language(); |
