@@ -19,6 +19,8 @@
1919
2020#include "abstractdbusservicemonitor.h"
2121
22+#include <QDBusInterface>
23+#include <QDBusServiceWatcher>
2224#include <QDBusConnection>
2325#include <QDBusConnectionInterface>
2426#include <QDBusReply>
@@ -32,14 +34,14 @@ AbstractDBusServiceMonitor::AbstractDBusServiceMonitor(QString service, QString
3234 , m_watcher(new QDBusServiceWatcher(service, QDBusConnection::sessionBus()))
3335 , m_dbusInterface(0)
3436{
35− connect(m_watcher, SIGNAL(serviceRegistered(QString)), SLOT(createInterface()));
36− connect(m_watcher, SIGNAL(serviceUnregistered(QString)), SLOT(destroyInterface()));
37+ connect(m_watcher, &QDBusServiceWatcher::serviceRegistered, this, &AbstractDBusServiceMonitor::createInterface);
38+ connect(m_watcher, &QDBusServiceWatcher::serviceUnregistered, this, &AbstractDBusServiceMonitor::destroyInterface);
3739
3840 // Connect to the service if it's up already
3941 QDBusConnectionInterface* sessionBus = QDBusConnection::sessionBus().interface();
4042 QDBusReply<bool> reply = sessionBus->isServiceRegistered(m_service);
4143 if (reply.isValid() && reply.value()) {
42− createInterface();
44+ createInterface(m_service);
4345 }
4446}
4547
@@ -51,11 +53,11 @@ AbstractDBusServiceMonitor::~AbstractDBusServiceMonitor()
5153 }
5254}
5355
54−void AbstractDBusServiceMonitor::createInterface()
56+void AbstractDBusServiceMonitor::createInterface(const QString &)
5557{
56− if (m_dbusInterface != 0) {
58+ if (m_dbusInterface != nullptr) {
5759 delete m_dbusInterface;
58− m_dbusInterface = 0;
60+ m_dbusInterface = nullptr;
5961 }
6062
6163 m_dbusInterface = new QDBusInterface(m_service, m_path, m_interface,
@@ -63,11 +65,11 @@ void AbstractDBusServiceMonitor::createInterface()
6365 Q_EMIT serviceAvailableChanged(true);
6466}
6567
66−void AbstractDBusServiceMonitor::destroyInterface()
68+void AbstractDBusServiceMonitor::destroyInterface(const QString &)
6769{
68− if (m_dbusInterface != 0) {
70+ if (m_dbusInterface != nullptr) {
6971 delete m_dbusInterface;
70− m_dbusInterface = 0;
72+ m_dbusInterface = nullptr;
7173 }
7274
7375 Q_EMIT serviceAvailableChanged(false);
@@ -80,5 +82,5 @@ QDBusInterface* AbstractDBusServiceMonitor::dbusInterface() const
8082
8183bool AbstractDBusServiceMonitor::serviceAvailable() const
8284{
83− return m_dbusInterface != 0;
85+ return m_dbusInterface != nullptr;
8486}