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

Fix multi instance

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