diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-11-15 01:23:15 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-11-15 01:23:15 +0100 |
commit | 715e2244b4ba27521496e4714aa3d97dad903864 (patch) | |
tree | 6657a85a9c86291e6fbd02d2ed9fa066c36d95e0 /src | |
parent | Update changelog (diff) | |
download | nheko-715e2244b4ba27521496e4714aa3d97dad903864.tar.xz |
Cleanup qt-jdenticon loading
Diffstat (limited to 'src')
-rw-r--r-- | src/JdenticonProvider.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/JdenticonProvider.cpp b/src/JdenticonProvider.cpp index e2828286..e421c932 100644 --- a/src/JdenticonProvider.cpp +++ b/src/JdenticonProvider.cpp @@ -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)); - QObject *plugin = pluginLoader.instance(); - if (plugin) { - interface = qobject_cast<JdenticonInterface *>(plugin); - if (interface) { - nhlog::ui()->info("Loaded jdenticon plugin."); - break; - } - } + QPluginLoader pluginLoader("qtjdenticon"); + QObject *plugin = pluginLoader.instance(); + if (plugin) { + interface = qobject_cast<JdenticonInterface *>(plugin); + if (interface) { + nhlog::ui()->info("Loaded jdenticon plugin."); } - } else { + } + + if (!interface) { nhlog::ui()->info("jdenticon plugin not found."); interfaceExists = false; } |