File indexing completed on 2024-11-24 05:00:11
0001 /* 0002 SPDX-FileCopyrightText: 2013, 2014, 2015 Ivan Cukic <ivan.cukic(at)kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "test.h" 0008 0009 #include <QDBusConnection> 0010 #include <QDBusConnectionInterface> 0011 0012 #include "common/dbus/common.h" 0013 0014 Test::Test(QObject *parent) 0015 : QObject(parent) 0016 { 0017 } 0018 0019 bool Test::inEmptySession() 0020 { 0021 const QStringList services = QDBusConnection::sessionBus().interface()->registeredServiceNames(); 0022 0023 for (const QString &service : services) { 0024 bool kdeServiceAndNotKAMD = service.startsWith(QStringLiteral("org.kde")) && service != KAMD_DBUS_SERVICE; 0025 0026 if (kdeServiceAndNotKAMD) { 0027 return false; 0028 } 0029 } 0030 0031 return true; 0032 } 0033 0034 bool Test::isActivityManagerRunning() 0035 { 0036 return QDBusConnection::sessionBus().interface()->isServiceRegistered(KAMD_DBUS_SERVICE); 0037 } 0038 0039 #include "moc_test.cpp"