Akonadi
servermanager.cpp
51 if (mState == ServerManager::Running && Internal::clientType() == Internal::User && !ServerManager::hasInstanceIdentifier()) {
73 if (!mFirstRunner && Internal::clientType() == Internal::User && !ServerManager::hasInstanceIdentifier()) {
80 QMetaObject::invokeMethod(mSafetyTimer.data(), qOverload<>(&QTimer::start), Qt::QueuedConnection); // in case we are in a different thread
82 QMetaObject::invokeMethod(mSafetyTimer.data(), &QTimer::stop, Qt::QueuedConnection); // in case we are in a different thread
116 d->serviceWatcher = std::make_unique<QDBusServiceWatcher>(ServerManager::serviceName(ServerManager::Server),
121 d->serviceWatcher->addWatchedService(ServerManager::serviceName(ServerManager::UpgradeIndicator));
123 // this (and also the two connects below) are queued so that they trigger after AgentManager is done loading
125 // this ensures the invariant of AgentManager reporting a consistent state if ServerManager::state() == Running
126 // that's the case with direct connections as well, but only after you enter the event loop once
141 if (name == ServerManager::serviceName(ServerManager::ControlLock) && d->mState == ServerManager::Starting) {
185 const bool controlRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::Control));
186 const bool serverRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::Server));
191 const bool controlLockRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::ControlLock));
205 qCWarning(AKONADICORE_LOG) << "Unable to execute akonadi_control, falling back to D-Bus auto-launch";
206 QDBusReply<void> reply = QDBusConnection::sessionBus().interface()->startService(ServerManager::serviceName(ServerManager::Control));
246 if (sInstance.exists()) { // be careful, this is called from the ServerManager::Private ctor, so using sInstance unprotected can cause infinite recursion
251 const bool serverUpgrading = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::UpgradeIndicator));
256 const bool controlRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::Control));
257 const bool serverRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::Server));
261 if (Internal::serverProtocolVersion() >= 0 && Internal::serverProtocolVersion() != Protocol::version()) {
263 "The Akonadi server protocol version differs from the protocol version used by this application.\n"
264 "If you recently updated your system please log out and back in to make sure all applications use the "
280 sInstance->mBrokenReason = i18n("There are no Akonadi Agents available. Please verify your KDE PIM installation.");
288 const bool controlLockRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(ServerManager::serviceName(ServerManager::ControlLock));
290 qCDebug(AKONADICORE_LOG) << "Akonadi server is only partially running. Server:" << serverRegistered << "ControlLock:" << controlLockRegistered
293 return NotRunning; // we don't know if it's starting or stopping, probably triggered by someone else
AgentType::List types() const
Returns the list of all available agent types.
Definition core/agentmanager.cpp:371
static AgentManager * self()
Returns the global instance of the agent manager.
Definition core/agentmanager.cpp:362
Provides methods to control the Akonadi server process.
Definition servermanager.h:29
static QString serverConfigFilePath(OpenMode openMode)
Returns absolute path to akonadiserverrc file with Akonadi server configuration.
Definition servermanager.cpp:357
static QString brokenReason()
Returns the reason why the Server is broken, if known.
Definition servermanager.cpp:309
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:343
static bool hasInstanceIdentifier()
Returns true if we are connected to a non-default Akonadi server instance.
Definition servermanager.cpp:322
static uint generation()
Returns current Akonadi database generation identifier.
Definition servermanager.cpp:375
static QString addNamespace(const QString &string)
Adds the multi-instance namespace to string if required (with '_' as separator).
Definition servermanager.cpp:367
@ Upgrading
Server is performing a database upgrade as part of a new startup.
Definition servermanager.h:42
@ NotRunning
Server is not running, could be no one started it yet or it failed to start.
Definition servermanager.h:37
void stateChanged(Akonadi::ServerManager::State state)
Emitted whenever the server state changes.
static ServerManager * self()
Returns the singleton instance of this class, for connecting to its signals.
Definition servermanager.cpp:178
static QString agentConfigFilePath(const QString &identifier)
Returns absolute path to configuration file of an agent identified by given identifier.
Definition servermanager.cpp:362
static QString instanceIdentifier()
Returns the identifier of the Akonadi instance we are connected to.
Definition servermanager.cpp:317
static QString serviceName(ServiceType serviceType)
Returns the namespaced D-Bus service name for serviceType.
Definition servermanager.cpp:327
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:229
QString i18n(const char *text, const TYPE &arg...)
Helper integration between Akonadi and Qt.
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
NoBlock
QDBusMessage call(QDBus::CallMode mode, const QString &method, Args &&... args)
bool isValid() const const
QDBusConnectionInterface * interface() const const
QDBusConnection sessionBus()
QDBusReply< bool > isServiceRegistered(const QString &serviceName) const const
QDBusReply< void > startService(const QString &name)
QString message() const const
const QDBusError & error()
bool isValid() const const
WatchForRegistration
void serviceRegistered(const QString &serviceName)
void serviceUnregistered(const QString &serviceName)
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
bool startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)
T * data() const const
QString findExecutable(const QString &executableName, const QStringList &paths)
bool isEmpty() const const
QueuedConnection
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void start()
void stop()
void timeout()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.