Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit aebf8a1b authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

akonadictl: fsck and vacuum require running Akonadi

BUG: 361542
FIXED-IN: 5.6.2
parent fc8db03b
......@@ -75,6 +75,11 @@ static bool stopServer()
return true;
}
static bool isAkonadiServerRunning()
{
return QDBusConnection::sessionBus().interface()->isServiceRegistered(Akonadi::DBus::serviceName(Akonadi::DBus::Server));
}
static bool checkAkonadiControlStatus()
{
const bool registered = QDBusConnection::sessionBus().interface()->isServiceRegistered(Akonadi::DBus::serviceName(Akonadi::DBus::Control));
......@@ -84,7 +89,7 @@ static bool checkAkonadiControlStatus()
static bool checkAkonadiServerStatus()
{
const bool registered = QDBusConnection::sessionBus().interface()->isServiceRegistered(Akonadi::DBus::serviceName(Akonadi::DBus::Server));
const bool registered = isAkonadiServerRunning();
std::cerr << "Akonadi Server: " << (registered ? "running" : "stopped") << std::endl;
return registered;
}
......@@ -161,6 +166,11 @@ static bool statusServer()
static void runJanitor(const QString &operation)
{
if (!isAkonadiServerRunning()) {
std::cerr << "Akonadi Server is not running, " << operation.toStdString() << " will not run" << std::endl;
return;
}
org::freedesktop::Akonadi::Janitor janitor(Akonadi::DBus::serviceName(Akonadi::DBus::StorageJanitor),
QStringLiteral(AKONADI_DBUS_STORAGEJANITOR_PATH),
QDBusConnection::sessionBus());
......
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