Akonadi

agentpluginloader.cpp
1/*
2 SPDX-FileCopyrightText: 2010 Bertjan Broeksema <broeksema@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6#include "agentpluginloader.h"
7#include "akonadiagentserver_debug.h"
8
9#include <QPluginLoader>
10
11AgentPluginLoader::AgentPluginLoader()
12{
13}
14
15AgentPluginLoader::~AgentPluginLoader()
16{
17 qDeleteAll(m_pluginLoaders);
18 m_pluginLoaders.clear();
19}
20
21QPluginLoader *AgentPluginLoader::load(const QString &pluginName)
22{
23 QPluginLoader *loader = m_pluginLoaders.value(pluginName);
24 if (loader) {
25 return loader;
26 } else {
27 loader = new QPluginLoader(pluginName);
28 if (!loader->load()) {
29 qCWarning(AKONADIAGENTSERVER_LOG) << "Failed to load agent: " << loader->errorString();
30 delete loader;
31 return nullptr;
32 }
33 m_pluginLoaders.insert(pluginName, loader);
34 return loader;
35 }
36}
void clear()
iterator insert(const Key &key, const T &value)
T value(const Key &key) const const
QString errorString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:11:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.