9#include "searchstore.h"
12#include "akonadi_search_core_debug.h"
14#include <QCoreApplication>
17#include <QPluginLoader>
18#include <QSharedPointer>
19#include <QThreadStorage>
23SearchStore::SearchStore(
QObject *parent)
28SearchStore::~SearchStore() =
default;
30QUrl SearchStore::url(
int)
54 List *list = &(*s_overrideSearchStores);
56 list->
reserve(overrideSearchStores.count());
72 if (s_overrideSearchStores && !s_overrideSearchStores->isEmpty()) {
73 qCDebug(AKONADI_SEARCH_CORE_LOG) <<
"Overriding search stores.";
74 return *s_overrideSearchStores;
82 for (
const QString &libraryPath : paths) {
83 const QString path(libraryPath + QStringLiteral(
"/pim6/akonadi"));
91 for (
const QString &fileName : entryList) {
97 pluginPaths << dir.absoluteFilePath(fileName);
103 for (
const QString &pluginPath : std::as_const(pluginPaths)) {
106 const QVariantMap metadata = loader.
metaData().
toVariantMap()[QStringLiteral(
"MetaData")].toMap();
107 if (metadata[QStringLiteral(
"X-Akonadi-PluginType")].toString() !=
"SearchStore"_L1) {
110 if (!loader.
load()) {
111 qCWarning(AKONADI_SEARCH_CORE_LOG) <<
"Could not create Akonadi Search Store: " << pluginPath;
112 qCWarning(AKONADI_SEARCH_CORE_LOG) << loader.
errorString();
119 stores << QSharedPointer<SearchStore>(ex);
120 qCDebug(AKONADI_SEARCH_CORE_LOG) <<
" Loaded plugins: " << pluginPath;
122 qCDebug(AKONADI_SEARCH_CORE_LOG) <<
"Plugin could not be converted to an Akonadi::Search::SearchStore " << pluginPath;
125 qCDebug(AKONADI_SEARCH_CORE_LOG) <<
"Plugin could not create instance" << pluginPath;
131#include "moc_searchstore.cpp"
static List searchStores()
Gives a list of available search stores.
Akonadi search infrastructure.
QStringList libraryPaths()
QVariantMap toVariantMap() const const
void append(QList< T > &&value)
void reserve(qsizetype size)
T qobject_cast(QObject *object)
QString errorString() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:50 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.