Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 0ee66c1a authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Port away from XdgBaseDirs::findPluginFile()

QPluginLoader (or rather QLibrary) is smart enough to append platform-specific
prefixes and suffixes and look into all paths, so we can just pass it the name
of the plugin and it will find the correct binary for us.
parent a4562418
......@@ -19,11 +19,8 @@
#include "agentpluginloader.h"
#include "akonadiagentserver_debug.h"
#include <private/xdgbasedirs_p.h>
#include <shared/akdebug.h>
using namespace Akonadi;
......@@ -36,23 +33,17 @@ AgentPluginLoader::~AgentPluginLoader()
QPluginLoader *AgentPluginLoader::load(const QString &pluginName)
const QString pluginFile = XdgBaseDirs::findPluginFile(pluginName);
if (pluginFile.isEmpty()) {
qCWarning(AKONADIAGENTSERVER_LOG) << "plugin file:" << pluginName << "not found!";
return nullptr;
QPluginLoader *loader = m_pluginLoaders.value(pluginFile);
QPluginLoader *loader = m_pluginLoaders.value(pluginName);
if (loader) {
return loader;
} else {
loader = new QPluginLoader(pluginFile);
loader = new QPluginLoader(pluginName);
if (!loader->load()) {
qCWarning(AKONADIAGENTSERVER_LOG) << "Failed to load agent: " << loader->errorString();
delete loader;
return nullptr;
m_pluginLoaders.insert(pluginFile, loader);
m_pluginLoaders.insert(pluginName, loader);
return loader;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment