mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Cleanup qt-jdenticon loading
This commit is contained in:
parent
c2494a7da4
commit
715e2244b4
1 changed files with 9 additions and 13 deletions
|
@ -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) {
|
QObject *plugin = pluginLoader.instance();
|
||||||
for (const QString &fileName : pluginsDir.entryList(QDir::Files)) {
|
if (plugin) {
|
||||||
QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
|
interface = qobject_cast<JdenticonInterface *>(plugin);
|
||||||
QObject *plugin = pluginLoader.instance();
|
if (interface) {
|
||||||
if (plugin) {
|
nhlog::ui()->info("Loaded jdenticon 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.");
|
nhlog::ui()->info("jdenticon plugin not found.");
|
||||||
interfaceExists = false;
|
interfaceExists = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue