Akonadi
servermanager.cpp
54 if (mState == ServerManager::Running && Internal::clientType() == Internal::User && !ServerManager::hasInstanceIdentifier()) {
76 if (!mFirstRunner && Internal::clientType() == Internal::User && !ServerManager::hasInstanceIdentifier()) {
83 QMetaObject::invokeMethod(mSafetyTimer.data(), qOverload<>(&QTimer::start), Qt::QueuedConnection); // in case we are in a different thread
85 QMetaObject::invokeMethod(mSafetyTimer.data(), &QTimer::stop, Qt::QueuedConnection); // in case we are in a different thread
124 d->serviceWatcher = std::make_unique<QDBusServiceWatcher>(ServerManager::serviceName(ServerManager::Server),
129 d->serviceWatcher->addWatchedService(ServerManager::serviceName(ServerManager::UpgradeIndicator));
131 // this (and also the two connects below) are queued so that they trigger after AgentManager is done loading
133 // this ensures the invariant of AgentManager reporting a consistent state if ServerManager::state() == Running
134 // that's the case with direct connections as well, but only after you enter the event loop once
149 if (name == ServerManager::serviceName(ServerManager::ControlLock) && d->mState == ServerManager::Starting) {
193 const bool controlRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::Control));
194 const bool serverRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::Server));
199 const bool controlLockRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::ControlLock));
213 qCWarning(AKONADICORE_LOG) << "Unable to execute akonadi_control, falling back to D-Bus auto-launch";
214 QDBusReply<void> reply = QDBusConnection::sessionBus().interface()->startService(ServerManager::serviceName(ServerManager::Control));
216 qCDebug(AKONADICORE_LOG) << "Akonadi server could not be started via D-Bus either: " << reply.error().message();
254 if (sInstance.exists()) { // be careful, this is called from the ServerManager::Private ctor, so using sInstance unprotected can cause infinite recursion
259 const bool serverUpgrading = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::UpgradeIndicator));
264 const bool controlRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::Control));
265 const bool serverRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::Server));
269 if (Internal::serverProtocolVersion() >= 0 && Internal::serverProtocolVersion() != Protocol::version()) {
271 "The Akonadi server protocol version differs from the protocol version used by this application.\n"
272 "If you recently updated your system please log out and back in to make sure all applications use the "
288 sInstance->mBrokenReason = i18n("There are no Akonadi Agents available. Please verify your KDE PIM installation.");
296 const bool controlLockRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::ControlLock));
298 qCDebug(AKONADICORE_LOG) << "Akonadi server is only partially running. Server:" << serverRegistered << "ControlLock:" << controlLockRegistered
301 return NotRunning; // we don't know if it's starting or stopping, probably triggered by someone else
@ Upgrading
Server is performing a database upgrade as part of a new startup.
Definition: servermanager.h:42
void start()
QString message() const const
bool isValid() const const
static ServerManager * self()
Returns the singleton instance of this class, for connecting to its signals.
Definition: servermanager.cpp:186
static QString serviceName(ServiceType serviceType)
Returns the namespaced D-Bus service name for serviceType.
Definition: servermanager.cpp:335
QDBusReply< bool > isServiceRegistered(const QString &serviceName) const const
static QString brokenReason()
Returns the reason why the Server is broken, if known.
Definition: servermanager.cpp:317
QDBusMessage call(const QString &method, Args &&... args)
void serviceUnregistered(const QString &serviceName)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
static QString agentServiceName(ServiceAgentType agentType, const QString &identifier)
Returns the namespaced D-Bus service name for an agent of type agentType with agent identifier identi...
Definition: servermanager.cpp:351
Q_GLOBAL_STATIC(Internal::StaticControl, s_instance) class ControlPrivate
Definition: control.cpp:28
QString findExecutable(const QString &executableName, const QStringList &paths)
@ NotRunning
Server is not running, could be no one started it yet or it failed to start.
Definition: servermanager.h:37
QDBusReply< void > startService(const QString &name)
void typeRemoved(const Akonadi::AgentType &type)
This signal is emitted whenever an agent type was removed from the system.
const QDBusError & error()
QString i18n(const char *text, const TYPE &arg...)
QDBusConnection sessionBus()
static bool isRunning()
Checks if the server is available currently.
Definition: servermanager.cpp:246
void timeout()
bool isEmpty() const const
static QString addNamespace(const QString &string)
Adds the multi-instance namespace to string if required (with '_' as separator).
Definition: servermanager.cpp:375
QueuedConnection
void serviceRegistered(const QString &serviceName)
QDBusConnectionInterface * interface() const const
static QString instanceIdentifier()
Returns the identifier of the Akonadi instance we are connected to.
Definition: servermanager.cpp:325
static QString serverConfigFilePath(OpenMode openMode)
Returns absolute path to akonadiserverrc file with Akonadi server configuration.
Definition: servermanager.cpp:365
bool isValid() const const
bool startDetached(qint64 *pid)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
unsigned int version()
void stop()
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
static AgentManager * self()
Returns the global instance of the agent manager.
Definition: core/agentmanager.cpp:355
static bool hasInstanceIdentifier()
Returns true if we are connected to a non-default Akonadi server instance.
Definition: servermanager.cpp:330
NoBlock
static QString agentConfigFilePath(const QString &identifier)
Returns absolute path to configuration file of an agent identified by given identifier.
Definition: servermanager.cpp:370
Provides methods to control the Akonadi server process.
Definition: servermanager.h:28
QObject * parent() const const
static void showSelfTestDialog(QWidget *parent)
Shows the Akonadi self test dialog, which tests Akonadi for various problems and reports these to the...
Definition: servermanager.cpp:237
static uint generation()
Returns current Akonadi database generation identifier.
Definition: servermanager.cpp:383
void typeAdded(const Akonadi::AgentType &type)
This signal is emitted whenever a new agent type was installed on the system.
WatchForRegistration
AgentType::List types() const
Returns the list of all available agent types.
Definition: core/agentmanager.cpp:364
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:58:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:58:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.