Commit 50934761 authored by Laurent Montel's avatar Laurent Montel 😁

Fix multi instance

parent 8c02537f
......@@ -28,6 +28,7 @@
#include <QDBusInterface>
#include <QDBusConnectionInterface>
#include <AkonadiCore/ServerManager>
#include <QDialog>
#include <QPushButton>
......@@ -54,7 +55,12 @@ public:
//Don't allow to reindex twice.
ui.reindexButton->setEnabled(false);
QDBusInterface indexingAgentIface(QStringLiteral("org.freedesktop.Akonadi.Agent.akonadi_indexing_agent"),
QString service = QStringLiteral("org.freedesktop.Akonadi.Agent.akonadi_indexing_agent");
if (Akonadi::ServerManager::hasInstanceIdentifier()) {
service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier();
}
QDBusInterface indexingAgentIface(service,
QStringLiteral("/"),
QStringLiteral("org.freedesktop.Akonadi.Indexer"));
if (indexingAgentIface.isValid()) {
......@@ -140,7 +146,12 @@ void CollectionMaintenancePage::load(const Collection &col)
if (!indexingWasEnabled) {
d->ui.indexedCountLbl->hide();
} else {
QDBusInterface indexingAgentIface(QStringLiteral("org.freedesktop.Akonadi.Agent.akonadi_indexing_agent"),
QString service = QStringLiteral("org.freedesktop.Akonadi.Agent.akonadi_indexing_agent");
if (Akonadi::ServerManager::hasInstanceIdentifier()) {
service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier();
}
QDBusInterface indexingAgentIface(service,
QStringLiteral("/"),
QStringLiteral("org.freedesktop.Akonadi.Indexer"));
if (indexingAgentIface.isValid()) {
......
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