Messagelib

sendlaterutil.cpp
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "sendlaterutil.h"
8 #include "sendlaterinterface.h"
9 #include "sendlaterutil_p.h"
10 
11 #include <Akonadi/ServerManager>
12 
13 #include <Akonadi/ServerManager>
14 
15 using namespace MessageComposer;
16 
17 QString SendLaterUtil::agentServiceName()
18 {
20  return ServerManager::agentServiceName(ServerManager::Agent, QStringLiteral("akonadi_sendlater_agent"));
21 }
22 
23 QString SendLaterUtil::dbusPath()
24 {
25  return QStringLiteral("/SendLaterAgent");
26 }
27 
28 bool SendLaterUtil::sentLaterAgentWasRegistered()
29 {
30  return org::freedesktop::Akonadi::SendLaterAgent{agentServiceName(), dbusPath(), QDBusConnection::sessionBus()}.isValid();
31 }
32 
33 bool SendLaterUtil::sentLaterAgentEnabled()
34 {
35  org::freedesktop::Akonadi::SendLaterAgent iface{agentServiceName(), dbusPath(), QDBusConnection::sessionBus()};
36  return iface.isValid() && iface.enabledAgent();
37 }
QDBusConnection sessionBus()
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.