Akonadi

agentserver/main.cpp
1/*
2 SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "agentserver.h"
8#include "akonadiagentserver_debug.h"
9
10#include "private/dbus_p.h"
11
12#include "shared/akapplication.h"
13
14#include <QDBusConnection>
15#include <QDBusConnectionInterface>
16
17int main(int argc, char **argv)
18{
19 AkCoreApplication app(argc, argv, AKONADIAGENTSERVER_LOG());
20 app.setDescription(QStringLiteral("Akonadi Agent Server\nDo not run manually, use 'akonadictl' instead to start/stop Akonadi."));
21 app.parseCommandLine();
22
23 if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(Akonadi::DBus::serviceName(Akonadi::DBus::ControlLock))) {
24 qCCritical(AKONADIAGENTSERVER_LOG) << "Akonadi control process not found - aborting.";
25 qFatal("If you started akonadi_agent_server manually, try 'akonadictl start' instead.");
26 }
27
28 new Akonadi::AgentServer(&app);
29
30 if (!QDBusConnection::sessionBus().registerService(Akonadi::DBus::serviceName(Akonadi::DBus::AgentServer))) {
31 qFatal("Unable to connect to dbus service: %s", qPrintable(QDBusConnection::sessionBus().lastError().message()));
32 }
33
34 return app.exec();
35}
QDBusConnection sessionBus()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.