NetworkManagerQt

vethdevice.cpp
1/*
2 SPDX-FileCopyrightText: 2013 Lukáš Tinkl <ltinkl@redhat.com>
3 SPDX-FileCopyrightText: 2014 Jan Grulich <jgrulich@redhat.com>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#include "manager.h"
9#include "manager_p.h"
10#include "vethdevice_p.h"
11
12NetworkManager::VethDevicePrivate::VethDevicePrivate(const QString &path, VethDevice *q)
13 : DevicePrivate(path, q)
14#ifdef NMQT_STATIC
15 , iface(NetworkManagerPrivate::DBUS_SERVICE, path, QDBusConnection::sessionBus())
16#else
17 , iface(NetworkManagerPrivate::DBUS_SERVICE, path, QDBusConnection::systemBus())
18#endif
19{
20}
21
22NetworkManager::VethDevicePrivate::~VethDevicePrivate()
23{
24}
25
26NetworkManager::VethDevice::VethDevice(const QString &path, QObject *parent)
27 : Device(*new VethDevicePrivate(path, this), parent)
28{
29 Q_D(VethDevice);
30
31 QVariantMap initialProperties = NetworkManagerPrivate::retrieveInitialProperties(d->iface.staticInterfaceName(), path);
32 if (!initialProperties.isEmpty()) {
33 d->propertiesChanged(initialProperties);
34 }
35}
36
37NetworkManager::VethDevice::~VethDevice()
38{
39}
40
45
46QString NetworkManager::VethDevice::peer() const
47{
48 Q_D(const VethDevice);
49 return d->peer;
50}
51
52void NetworkManager::VethDevicePrivate::propertyChanged(const QString &property, const QVariant &value)
53{
54 Q_Q(VethDevice);
55
56 if (property == QLatin1String("Peer")) {
57 peer = value.toString();
58 Q_EMIT q->peerChanged(peer);
59 } else {
60 DevicePrivate::propertyChanged(property, value);
61 }
62}
63
64#include "moc_vethdevice.cpp"
65#include "moc_vethdevice_p.cpp"
Type
Device type.
Definition device.h:191
@ Veth
Veth virtual device.
Definition device.h:211
A veth device interface.
Definition vethdevice.h:22
Type type() const override
Retrieves the interface type.
QString path(const QString &relativePath)
QString toString() const const
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:59:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.