Akonadi

kjobprivatebase.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 "kjobprivatebase_p.h"
8
9using namespace Akonadi;
10
11void KJobPrivateBase::start()
12{
13 const ServerManager::State serverState = ServerManager::state();
14
15 if (serverState == ServerManager::Running) {
16 doStart();
17 return;
18 }
19
20 connect(ServerManager::self(), &ServerManager::stateChanged, this, &KJobPrivateBase::serverStateChanged);
21
22 if (serverState == ServerManager::NotRunning) {
23 ServerManager::start();
24 }
25}
26
27void KJobPrivateBase::serverStateChanged(Akonadi::ServerManager::State state)
28{
29 if (state == ServerManager::Running) {
30 disconnect(ServerManager::self(), &ServerManager::stateChanged, this, &KJobPrivateBase::serverStateChanged);
31 doStart();
32 }
33}
34
35#include "moc_kjobprivatebase_p.cpp"
State
Enum for the various states the server can be in.
Helper integration between Akonadi and Qt.
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.