Merge pull request #993 from lambdcalculus/master
Fix incorrect error messages due to QPluginLoader
This commit is contained in:
commit
c1f120adfb
18
src/main.cpp
18
src/main.cpp
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
|
#include <QImageReader>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QPluginLoader>
|
|
||||||
#include <QResource>
|
#include <QResource>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
|
||||||
@ -28,7 +28,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AOApplication::addLibraryPath(AOApplication::applicationDirPath() + "/lib");
|
|
||||||
QResource::registerResource(main_app.get_asset("themes/" + Options::getInstance().theme() + ".rcc"));
|
QResource::registerResource(main_app.get_asset("themes/" + Options::getInstance().theme() + ".rcc"));
|
||||||
|
|
||||||
QFont main_font = main_app.font();
|
QFont main_font = main_app.font();
|
||||||
@ -46,16 +45,19 @@ int main(int argc, char *argv[])
|
|||||||
fontDatabase.addApplicationFont(it.next());
|
fontDatabase.addApplicationFont(it.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
QPluginLoader apngPlugin("qapng");
|
QStringList missing_formats{"webp", "apng", "gif"};
|
||||||
if (!apngPlugin.load())
|
for (const QByteArray &i_format : QImageReader::supportedImageFormats())
|
||||||
{
|
{
|
||||||
qCritical() << "QApng plugin could not be loaded";
|
missing_formats.removeAll(i_format.toLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
QPluginLoader webpPlugin("qwebp");
|
if (!missing_formats.empty())
|
||||||
if (!webpPlugin.load())
|
|
||||||
{
|
{
|
||||||
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();
|
QString p_language = Options::getInstance().language();
|
||||||
|
Loading…
Reference in New Issue
Block a user