Cleanup qt-jdenticon loading
This commit is contained in:
parent
c2494a7da4
commit
715e2244b4
|
@ -88,20 +88,16 @@ getJdenticonInterface()
|
||||||
if (interface == nullptr && interfaceExists) {
|
if (interface == nullptr && interfaceExists) {
|
||||||
QDir pluginsDir(qApp->applicationDirPath());
|
QDir pluginsDir(qApp->applicationDirPath());
|
||||||
|
|
||||||
bool plugins = pluginsDir.cd("plugins");
|
QPluginLoader pluginLoader("qtjdenticon");
|
||||||
if (plugins) {
|
|
||||||
for (const QString &fileName : pluginsDir.entryList(QDir::Files)) {
|
|
||||||
QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
|
|
||||||
QObject *plugin = pluginLoader.instance();
|
QObject *plugin = pluginLoader.instance();
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
interface = qobject_cast<JdenticonInterface *>(plugin);
|
interface = qobject_cast<JdenticonInterface *>(plugin);
|
||||||
if (interface) {
|
if (interface) {
|
||||||
nhlog::ui()->info("Loaded jdenticon plugin.");
|
nhlog::ui()->info("Loaded jdenticon plugin.");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
if (!interface) {
|
||||||
nhlog::ui()->info("jdenticon plugin not found.");
|
nhlog::ui()->info("jdenticon plugin not found.");
|
||||||
interfaceExists = false;
|
interfaceExists = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue