From 715e2244b4ba27521496e4714aa3d97dad903864 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 15 Nov 2021 01:23:15 +0100 Subject: [PATCH] Cleanup qt-jdenticon loading --- src/JdenticonProvider.cpp | 22 +++++++++------------- 1 file 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(plugin); - if (interface) { - nhlog::ui()->info("Loaded jdenticon plugin."); - break; - } - } + QPluginLoader pluginLoader("qtjdenticon"); + QObject *plugin = pluginLoader.instance(); + if (plugin) { + interface = qobject_cast(plugin); + if (interface) { + nhlog::ui()->info("Loaded jdenticon plugin."); } - } else { + } + + if (!interface) { nhlog::ui()->info("jdenticon plugin not found."); interfaceExists = false; }