Akonadi

kjobprivatebase.cpp
1 /*
2  SPDX-FileCopyrightText: 2010 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "kjobprivatebase_p.h"
8 
9 using namespace Akonadi;
10 
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) {
24  }
25 }
26 
27 void 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"
static bool start()
Starts the server.
static State state()
Returns the state of the server.
static ServerManager * self()
Returns the singleton instance of this class, for connecting to its signals.
Q_SCRIPTABLE Q_NOREPLY void start()
void stateChanged(Akonadi::ServerManager::State state)
Emitted whenever the server state changes.
@ Running
Server is running and operational.
Definition: servermanager.h:39
@ NotRunning
Server is not running, could be no one started it yet or it failed to start.
Definition: servermanager.h:37
State
Enum for the various states the server can be in.
Definition: servermanager.h:36
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.