Cleanup qt-jdenticon loading

This commit is contained in:
Nicolas Werner 2021-11-15 01:23:15 +01:00
parent c2494a7da4
commit 715e2244b4
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -88,20 +88,16 @@ getJdenticonInterface()
if (interface == nullptr && interfaceExists) {
QDir pluginsDir(qApp->applicationDirPath());
bool plugins = pluginsDir.cd("plugins");
if (plugins) {
for (const QString &fileName : pluginsDir.entryList(QDir::Files)) {
QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
QPluginLoader pluginLoader("qtjdenticon");
QObject *plugin = pluginLoader.instance();
if (plugin) {
interface = qobject_cast<JdenticonInterface *>(plugin);
if (interface) {
nhlog::ui()->info("Loaded jdenticon plugin.");
break;
}
}
}
} else {
if (!interface) {
nhlog::ui()->info("jdenticon plugin not found.");
interfaceExists = false;
}