1/*
2 SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#include "ksystemclockskewnotifierengine_p.h"
8
9#include "config-util.h"
10
11#if defined(Q_OS_LINUX)
12#include "ksystemclockskewnotifierengine_linux.h"
13#elif HAVE_QTDBUS
14#include "ksystemclockskewnotifierengine_dbus.h"
15#endif
16
17std::shared_ptr<KSystemClockSkewNotifierEngine> KSystemClockSkewNotifierEngine::globalInstance()
18{
19 static std::weak_ptr<KSystemClockSkewNotifierEngine> singleton;
20 if (auto instance = singleton.lock()) {
21 return instance;
22 }
23
24 std::shared_ptr<KSystemClockSkewNotifierEngine> instance;
25#if defined(Q_OS_LINUX)
26 instance = KLinuxSystemClockSkewNotifierEngine::create();
27#elif HAVE_QTDBUS
28 instance = KDBusSystemClockSkewNotifierEngine::create();
29#endif
30
31 singleton = instance;
32 return instance;
33}
34
35KSystemClockSkewNotifierEngine::KSystemClockSkewNotifierEngine(QObject *parent)
36 : QObject(parent)
37{
38}
39
40#include "moc_ksystemclockskewnotifierengine_p.cpp"
41

source code of kcoreaddons/src/lib/util/ksystemclockskewnotifierengine.cpp