NetworkManagerQt

adsldevice.cpp
1/*
2 SPDX-FileCopyrightText: 2012-2013 Jan Grulich <jgrulich@redhat.com>
3 SPDX-FileCopyrightText: 2013 Daniel Nicoletti <dantti12@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#include "adsldevice_p.h"
9
10NetworkManager::AdslDevicePrivate::AdslDevicePrivate(const QString &path, AdslDevice *q)
11 : DevicePrivate(path, q)
12#ifdef NMQT_STATIC
13 , iface(NetworkManagerPrivate::DBUS_SERVICE, path, QDBusConnection::sessionBus())
14#else
15 , iface(NetworkManagerPrivate::DBUS_SERVICE, path, QDBusConnection::systemBus())
16#endif
17 , carrier(false)
18{
19}
20
21NetworkManager::AdslDevice::~AdslDevice()
22{
23}
24
25NetworkManager::AdslDevice::AdslDevice(const QString &path, QObject *parent)
26 : Device(*new AdslDevicePrivate(path, this), parent)
27{
28 Q_D(AdslDevice);
29
30 QVariantMap initialProperties = NetworkManagerPrivate::retrieveInitialProperties(d->iface.staticInterfaceName(), path);
31 if (!initialProperties.isEmpty()) {
32 d->propertiesChanged(initialProperties);
33 }
34}
35
36NetworkManager::AdslDevicePrivate::~AdslDevicePrivate()
37{
38}
39
44
45bool NetworkManager::AdslDevice::carrier() const
46{
47 Q_D(const AdslDevice);
48
49 return d->carrier;
50}
51
52void NetworkManager::AdslDevicePrivate::propertyChanged(const QString &property, const QVariant &value)
53{
54 Q_Q(AdslDevice);
55
56 if (property == QLatin1String("Carrier")) {
57 carrier = value.toBool();
58 Q_EMIT q->carrierChanged(carrier);
59 } else {
60 DevicePrivate::propertyChanged(property, value);
61 }
62}
63
64#include "moc_adsldevice.cpp"
65#include "moc_adsldevice_p.cpp"
An adsl device interface.
Definition adsldevice.h:21
Type type() const override
Retrieves the interface type.
Type
Device type.
Definition device.h:191
@ Adsl
ADSL modem device.
Definition device.h:204
QString path(const QString &relativePath)
bool toBool() const const
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:01:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.