From e189f69df20e888b0a2f88076cee02fd193ae181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 25 Nov 2016 12:27:50 +0100 Subject: [PATCH] continue with documentation update and increase json timeout to 15 s --- doc/jsonrpc.qdoc | 4 + guh.pro | 4 +- server/guhcore.cpp | 8 ++ server/jsonrpc/cloudhandler.cpp | 21 ++++ server/jsonrpc/configurationhandler.cpp | 42 +++++++ server/jsonrpc/jsonhandler.cpp | 2 +- server/jsonrpc/jsonrpcserver.cpp | 9 +- server/jsonrpc/jsontypes.cpp | 4 + server/jsonrpc/networkmanagerhandler.cpp | 52 +++++++- server/logging/logengine.cpp | 3 +- server/networkmanager/networkconnection.cpp | 26 ++++ server/networkmanager/networkconnection.h | 4 - server/networkmanager/networkdevice.cpp | 117 +++++++++++++++++- .../networkmanager/wirelessnetworkdevice.cpp | 11 +- server/networkmanager/wirelessnetworkdevice.h | 2 +- 15 files changed, 287 insertions(+), 22 deletions(-) diff --git a/doc/jsonrpc.qdoc b/doc/jsonrpc.qdoc index 36eb09d2..59c8acea 100644 --- a/doc/jsonrpc.qdoc +++ b/doc/jsonrpc.qdoc @@ -54,6 +54,10 @@ \endcode Now the connection is established and waits for commands. + \section1 Classes + + \annotatedlist json + \section1 Examples diff --git a/guh.pro b/guh.pro index ec581d7c..c0312a05 100644 --- a/guh.pro +++ b/guh.pro @@ -25,8 +25,8 @@ tests.depends = libguh doc.depends = libguh server # Note: some how extraimages in qdocconf did not the trick -doc.commands = cd $$top_srcdir/doc; qdoc config.qdocconf; cp images/* html/images/; \ - cp favicons/* html/; cp -r $$top_srcdir/doc/html $$top_builddir/ +doc.commands = cd $$top_srcdir/doc; qdoc config.qdocconf; cp -r images/* html/images/; \ + cp -r favicons/* html/; cp -r $$top_srcdir/doc/html $$top_builddir/ licensecheck.commands = $$top_srcdir/tests/auto/checklicenseheaders.sh $$top_srcdir diff --git a/server/guhcore.cpp b/server/guhcore.cpp index b96f65f7..55d3ce7d 100644 --- a/server/guhcore.cpp +++ b/server/guhcore.cpp @@ -343,6 +343,12 @@ RuleEngine::RuleError GuhCore::removeRule(const RuleId &id) return removeError; } +/*! Returns a pointer to the \l{GuhConfiguration} instance owned by GuhCore.*/ +GuhConfiguration *GuhCore::configuration() const +{ + return m_configuration; +} + /*! Returns a pointer to the \l{DeviceManager} instance owned by GuhCore.*/ DeviceManager *GuhCore::deviceManager() const { @@ -361,6 +367,7 @@ TimeManager *GuhCore::timeManager() const return m_timeManager; } +/*! Returns a pointer to the \l{WebServer} instance owned by GuhCore.*/ WebServer *GuhCore::webServer() const { return m_webServer; @@ -409,6 +416,7 @@ MockTcpServer *GuhCore::tcpServer() const return m_tcpServer; } #else +/*! Returns a pointer to the \l{TcpServer} instance owned by GuhCore. */ TcpServer *GuhCore::tcpServer() const { return m_tcpServer; diff --git a/server/jsonrpc/cloudhandler.cpp b/server/jsonrpc/cloudhandler.cpp index 6b39188d..eccc46b4 100644 --- a/server/jsonrpc/cloudhandler.cpp +++ b/server/jsonrpc/cloudhandler.cpp @@ -18,10 +18,30 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*! + \class guhserver::CloudHandler + \brief This subclass of \l{JsonHandler} processes the JSON requests for the \tt Cloud namespace. + + \ingroup json + \inmodule core + + This \l{JsonHandler} will be created in the \l{JsonRPCServer} and used to handle JSON-RPC requests + for the \tt {Cloud} namespace of the API. + + \sa JsonHandler, JsonRPCServer +*/ + +/*! \fn void guhserver::CloudHandler::ConnectionStatusChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when the status of the \l{CloudManager} has changed. + The \a params contains the map for the notification. +*/ + + #include "cloudhandler.h" namespace guhserver { +/*! Constructs a new \l CloudHandler with the given \a parent. */ CloudHandler::CloudHandler(QObject *parent) : JsonHandler(parent) { @@ -66,6 +86,7 @@ CloudHandler::CloudHandler(QObject *parent) : connect(GuhCore::instance()->cloudManager(), SIGNAL(authenticatedChanged()), this, SLOT(onConnectionStatusChanged())); } +/*! Returns the name of the \l{CloudHandler}. In this case \b Cloud.*/ QString CloudHandler::name() const { return "Cloud"; diff --git a/server/jsonrpc/configurationhandler.cpp b/server/jsonrpc/configurationhandler.cpp index 595a7345..d187182f 100644 --- a/server/jsonrpc/configurationhandler.cpp +++ b/server/jsonrpc/configurationhandler.cpp @@ -18,11 +18,52 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*! + \class guhserver::ConfigurationHandler + \brief This subclass of \l{JsonHandler} processes the JSON requests for the \tt Configuration namespace. + + \ingroup json + \inmodule core + + This \l{JsonHandler} will be created in the \l{JsonRPCServer} and used to handle JSON-RPC requests + for the \tt {Configuration} namespace of the API. + + \sa JsonHandler, JsonRPCServer +*/ + +/*! \fn void guhserver::ConfigurationHandler::BasicConfigurationChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when the configurations of the server have been changed. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::ConfigurationHandler::TcpServerConfigurationChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when the configurations of the \l{TcpServer} have been changed. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::ConfigurationHandler::WebServerConfigurationChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when the configurations of the \l{WebServer} have been changed. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::ConfigurationHandler::WebSocketServerConfigurationChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when the configurations of the \l{WebSocketServer} have been changed. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::ConfigurationHandler::LanguageChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when the language of the system has changed. + The \a params contains the map for the notification. +*/ + + + #include "configurationhandler.h" #include "guhcore.h" namespace guhserver { +/*! Constructs a new \l ConfigurationHandler with the given \a parent. */ ConfigurationHandler::ConfigurationHandler(QObject *parent): JsonHandler(parent) { @@ -152,6 +193,7 @@ ConfigurationHandler::ConfigurationHandler(QObject *parent): connect(GuhCore::instance()->deviceManager(), &DeviceManager::languageUpdated, this, &ConfigurationHandler::onLanguageChanged); } +/*! Returns the name of the \l{ConfigurationHandler}. In this case \b Configuration.*/ QString ConfigurationHandler::name() const { return "Configuration"; diff --git a/server/jsonrpc/jsonhandler.cpp b/server/jsonrpc/jsonhandler.cpp index 48e8f1d9..2d21acd9 100644 --- a/server/jsonrpc/jsonhandler.cpp +++ b/server/jsonrpc/jsonhandler.cpp @@ -336,7 +336,7 @@ void JsonReply::setCommandId(int commandId) /*! Start the timeout timer for this \l{JsonReply}. The default timeout is 10 seconds. */ void JsonReply::startWait() { - m_timeout.start(10000); + m_timeout.start(15000); } void JsonReply::timeout() diff --git a/server/jsonrpc/jsonrpcserver.cpp b/server/jsonrpc/jsonrpcserver.cpp index 374421db..a2e73b2b 100644 --- a/server/jsonrpc/jsonrpcserver.cpp +++ b/server/jsonrpc/jsonrpcserver.cpp @@ -112,15 +112,15 @@ JsonReply* JsonRPCServer::Introspect(const QVariantMap ¶ms) const QVariantMap data; data.insert("types", JsonTypes::allTypes()); QVariantMap methods; - foreach (JsonHandler *handler, m_handlers) { + foreach (JsonHandler *handler, m_handlers) methods.unite(handler->introspect(QMetaMethod::Method)); - } + data.insert("methods", methods); QVariantMap signalsMap; - foreach (JsonHandler *handler, m_handlers) { + foreach (JsonHandler *handler, m_handlers) signalsMap.unite(handler->introspect(QMetaMethod::Signal)); - } + data.insert("notifications", signalsMap); return createReply(data); @@ -151,6 +151,7 @@ QHash JsonRPCServer::handlers() const return m_handlers; } +/*! Register a new \l{TransportInterface} to the JSON server. The \a enabled flag indivates if the given \a interface sould be enebeld on startup. */ void JsonRPCServer::registerTransportInterface(TransportInterface *interface, const bool &enabled) { // Now set up the logic diff --git a/server/jsonrpc/jsontypes.cpp b/server/jsonrpc/jsontypes.cpp index ce546724..a377d5a6 100644 --- a/server/jsonrpc/jsontypes.cpp +++ b/server/jsonrpc/jsontypes.cpp @@ -1065,6 +1065,7 @@ QVariantList JsonTypes::packDeviceDescriptors(const QList devi return deviceDescriptorList; } +/*! Returns a variant map with the current basic configuration of the server. */ QVariantMap JsonTypes::packBasicConfiguration() { QVariantMap basicConfiguration; @@ -1076,6 +1077,7 @@ QVariantMap JsonTypes::packBasicConfiguration() return basicConfiguration; } +/*! Returns a variant map with the current tcp configuration of the server. */ QVariantMap JsonTypes::packTcpServerConfiguration() { QVariantMap tcpServerConfiguration; @@ -1084,6 +1086,7 @@ QVariantMap JsonTypes::packTcpServerConfiguration() return tcpServerConfiguration; } +/*! Returns a variant map with the current web server configuration of the server. */ QVariantMap JsonTypes::packWebServerConfiguration() { QVariantMap webServerConfiguration; @@ -1092,6 +1095,7 @@ QVariantMap JsonTypes::packWebServerConfiguration() return webServerConfiguration; } +/*! Returns a variant map with the current web socket server configuration of the server. */ QVariantMap JsonTypes::packWebSocketServerConfiguration() { QVariantMap webSocketServerConfiguration; diff --git a/server/jsonrpc/networkmanagerhandler.cpp b/server/jsonrpc/networkmanagerhandler.cpp index b624e694..9c311db2 100644 --- a/server/jsonrpc/networkmanagerhandler.cpp +++ b/server/jsonrpc/networkmanagerhandler.cpp @@ -18,6 +18,55 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*! + \class guhserver::NetworkManagerHandler + \brief This subclass of \l{JsonHandler} processes the JSON requests for the \tt NetworkManager namespace of the JSON-RPC API. + + \ingroup json + \inmodule core + + This \l{JsonHandler} will be created in the \l{JsonRPCServer} and used to handle JSON-RPC requests + for the \tt {NetworkManager} namespace of the API. + + \sa NetworkManager, JsonHandler, JsonRPCServer +*/ + +/*! \fn void guhserver::NetworkManagerHandler::NetworkStatusChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when the state of the \l{NetworkManager} has changed. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::NetworkManagerHandler::WiredNetworkDeviceAdded(const QVariantMap ¶ms); + This signal is emitted to the API notifications when a \l{WiredNetworkDevice} has been added to the \l{NetworkManager}. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::NetworkManagerHandler::WiredNetworkDeviceRemoved(const QVariantMap ¶ms); + This signal is emitted to the API notifications when a \l{WiredNetworkDevice} has been removed from the \l{NetworkManager}. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::NetworkManagerHandler::WiredNetworkDeviceChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when a \l{WiredNetworkDevice} has changed in the \l{NetworkManager}. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::NetworkManagerHandler::WirelessNetworkDeviceAdded(const QVariantMap ¶ms); + This signal is emitted to the API notifications when a \l{WirelessNetworkDevice} has been added to the \l{NetworkManager}. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::NetworkManagerHandler::WirelessNetworkDeviceRemoved(const QVariantMap ¶ms); + This signal is emitted to the API notifications when a \l{WirelessNetworkDevice} has been removed from the \l{NetworkManager}. + The \a params contains the map for the notification. +*/ + +/*! \fn void guhserver::NetworkManagerHandler::WirelessNetworkDeviceChanged(const QVariantMap ¶ms); + This signal is emitted to the API notifications when a \l{WirelessNetworkDevice} has changed in the \l{NetworkManager}. + The \a params contains the map for the notification. +*/ + + #include "guhcore.h" #include "jsontypes.h" #include "loggingcategories.h" @@ -27,6 +76,7 @@ namespace guhserver { +/*! Constructs a new \l{NetworkManagerHandler} with the given \a parent. */ NetworkManagerHandler::NetworkManagerHandler(QObject *parent) : JsonHandler(parent) { @@ -143,9 +193,9 @@ NetworkManagerHandler::NetworkManagerHandler(QObject *parent) : connect(GuhCore::instance()->networkManager(), &NetworkManager::wiredDeviceAdded, this, &NetworkManagerHandler::onWiredNetworkDeviceAdded); connect(GuhCore::instance()->networkManager(), &NetworkManager::wiredDeviceRemoved, this, &NetworkManagerHandler::onWiredNetworkDeviceRemoved); connect(GuhCore::instance()->networkManager(), &NetworkManager::wiredDeviceChanged, this, &NetworkManagerHandler::onWiredNetworkDeviceChanged); - } +/*! Returns the name of the \l{NetworkManagerHandler}. In this case \b NetworkManager. */ QString NetworkManagerHandler::name() const { return "NetworkManager"; diff --git a/server/logging/logengine.cpp b/server/logging/logengine.cpp index d0945d14..f1f96c3f 100644 --- a/server/logging/logengine.cpp +++ b/server/logging/logengine.cpp @@ -82,6 +82,7 @@ This event type describes the actions execution of a \l{Rule}. \value LoggingEventTypeExitActionsExecuted This event type describes the exit actions execution of a \l{Rule}. + \value LoggingEventTypeEnabledChange */ @@ -106,7 +107,7 @@ \value LoggingSourceStates This \l{LogEntry} was created from an \l{State} which hase changed. \value LoggingSourceRules - This \l{LogEntry} was created from an \l{Rule} which hase changed the active state or triggered. + This \l{LogEntry} represents the enable/disable event from an \l{Rule}. */ #include "guhsettings.h" diff --git a/server/networkmanager/networkconnection.cpp b/server/networkmanager/networkconnection.cpp index 7f1fae53..eb25d9f9 100644 --- a/server/networkmanager/networkconnection.cpp +++ b/server/networkmanager/networkconnection.cpp @@ -18,6 +18,16 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*! + \class guhserver::NetworkConnection + \brief Represents a saved network connection of the \l{NetworkManager}. + + \ingroup networkmanager + \inmodule core + + \sa NetworkSettings +*/ + #include "networkconnection.h" #include "dbus-interfaces.h" #include "loggingcategories.h" @@ -26,6 +36,7 @@ namespace guhserver { +/*! Constructs a new \l{NetworkConnection} with the given dbus \a objectPath and \a parent. */ NetworkConnection::NetworkConnection(const QDBusObjectPath &objectPath, QObject *parent) : QObject(parent), m_objectPath(objectPath) @@ -51,6 +62,7 @@ NetworkConnection::NetworkConnection(const QDBusObjectPath &objectPath, QObject m_connectionSettings = qdbus_cast(argument); } +/*! Delets this \l{NetworkConnection} in the \l{NetworkManager}. */ void NetworkConnection::deleteConnection() { QDBusMessage query = m_connectionInterface->call("Delete"); @@ -59,41 +71,55 @@ void NetworkConnection::deleteConnection() } +/*! Returns the dbus object path of this \l{NetworkConnection}. */ QDBusObjectPath NetworkConnection::objectPath() const { return m_objectPath; } +/*! Returns the connection settings of this \l{NetworkConnection}. */ +ConnectionSettings NetworkConnection::connectionSettings() const +{ + return m_connectionSettings; +} + +/*! Returns the id of this \l{NetworkConnection}. */ QString NetworkConnection::id() const { return m_connectionSettings.value("connection").value("id").toString(); } +/*! Returns the name of this \l{NetworkConnection}. */ QString NetworkConnection::name() const { return m_connectionSettings.value("connection").value("name").toString(); } +/*! Returns the type of this \l{NetworkConnection}. */ QString NetworkConnection::type() const { return m_connectionSettings.value("connection").value("type").toString(); } +/*! Returns the uuid of this \l{NetworkConnection}. */ QUuid NetworkConnection::uuid() const { return m_connectionSettings.value("connection").value("uuid").toUuid(); } +/*! Returns the interface name of this \l{NetworkConnection}. */ QString NetworkConnection::interfaceName() const { return m_connectionSettings.value("connection").value("interface-name").toString(); } +/*! Returns true if this \l{NetworkConnection} will autoconnect if available. */ bool NetworkConnection::autoconnect() const { return m_connectionSettings.value("connection").value("autoconnect").toBool(); } +/*! Returns the timestamp of this \l{NetworkConnection} from the last connection. */ QDateTime NetworkConnection::timeStamp() const { return QDateTime::fromTime_t(m_connectionSettings.value("connection").value("timestamp").toUInt()); diff --git a/server/networkmanager/networkconnection.h b/server/networkmanager/networkconnection.h index 97ea831f..87581923 100644 --- a/server/networkmanager/networkconnection.h +++ b/server/networkmanager/networkconnection.h @@ -60,10 +60,6 @@ private: ConnectionSettings m_connectionSettings; -signals: - -public slots: - }; QDebug operator<<(QDebug debug, NetworkConnection *networkConnection); diff --git a/server/networkmanager/networkdevice.cpp b/server/networkmanager/networkdevice.cpp index 7bce169f..9377d197 100644 --- a/server/networkmanager/networkdevice.cpp +++ b/server/networkmanager/networkdevice.cpp @@ -28,6 +28,117 @@ \sa WiredNetworkDevice, WirelessNetworkDevice */ +/*! \enum guhserver::NetworkDevice::NetworkDeviceState + \value NetworkDeviceStateUnknown + \value NetworkDeviceStateUnmanaged + \value NetworkDeviceStateUnavailable + \value NetworkDeviceStateDisconnected + \value NetworkDeviceStatePrepare + \value NetworkDeviceStateConfig + \value NetworkDeviceStateNeedAuth + \value NetworkDeviceStateIpConfig + \value NetworkDeviceStateIpCheck + \value NetworkDeviceStateSecondaries + \value NetworkDeviceStateActivated + \value NetworkDeviceStateDeactivating + \value NetworkDeviceStateFailed +*/ + +/*! \enum guhserver::NetworkDevice::NetworkDeviceStateReason + \value NetworkDeviceStateReasonNone + \value NetworkDeviceStateReasonUnknown + \value NetworkDeviceStateReasonNowManaged + \value NetworkDeviceStateReasonNowUnmanaged + \value NetworkDeviceStateReasonConfigFailed + \value NetworkDeviceStateReasonIpConfigUnavailable + \value NetworkDeviceStateReasonIpConfigExpired + \value NetworkDeviceStateReasonNoSecrets + \value NetworkDeviceStateReasonSupplicantDisconnected + \value NetworkDeviceStateReasonSupplicantConfigFailed + \value NetworkDeviceStateReasonSupplicantFailed + \value NetworkDeviceStateReasonSupplicantTimeout + \value NetworkDeviceStateReasonPppStartFailed + \value NetworkDeviceStateReasonPppDisconnected + \value NetworkDeviceStateReasonPppFailed + \value NetworkDeviceStateReasonDhcpStartFailed + \value NetworkDeviceStateReasonDhcpError + \value NetworkDeviceStateReasonDhcpFailed + \value NetworkDeviceStateReasonSharedStartFailed + \value NetworkDeviceStateReasonSharedFailed + \value NetworkDeviceStateReasonAutoIpStartFailed + \value NetworkDeviceStateReasonAutoIpError + \value NetworkDeviceStateReasonAutoIpFailed + \value NetworkDeviceStateReasonModemBusy + \value NetworkDeviceStateReasonModemNoDialTone + \value NetworkDeviceStateReasonModemNoCarrier + \value NetworkDeviceStateReasonModemDialTimeout + \value NetworkDeviceStateReasonModemDialFailed + \value NetworkDeviceStateReasonModemInitFailed + \value NetworkDeviceStateReasonGsmApnFailed + \value NetworkDeviceStateReasonGsmRegistrationNotSearching + \value NetworkDeviceStateReasonGsmRegistrationDenied + \value NetworkDeviceStateReasonGsmRegistrationTimeout + \value NetworkDeviceStateReasonGsmRegistrationFailed + \value NetworkDeviceStateReasonGsmPinCheckFailed + \value NetworkDeviceStateReasonFirmwareMissing + \value NetworkDeviceStateReasonRemoved + \value NetworkDeviceStateReasonSleeping + \value NetworkDeviceStateReasonConnectionRemoved + \value NetworkDeviceStateReasonUserRequest + \value NetworkDeviceStateReasonCarrier + \value NetworkDeviceStateReasonConnectionAssumed + \value NetworkDeviceStateReasonSupplicantAvailable + \value NetworkDeviceStateReasonModemNotFound + \value NetworkDeviceStateReasonBtFailed + \value NetworkDeviceStateReasonGsmSimNotInserted + \value NetworkDeviceStateReasonGsmSimPinRequired + \value NetworkDeviceStateReasonGsmSimPukRequired + \value NetworkDeviceStateReasonGsmSimWrong + \value NetworkDeviceStateReasonInfinibandMode + \value NetworkDeviceStateReasonDependencyFailed + \value NetworkDeviceStateReasonBR2684Failed + \value NetworkDeviceStateReasonModemManagerUnavailable + \value NetworkDeviceStateReasonSsidNotFound + \value NetworkDeviceStateReasonSecondaryConnectionFailed + \value NetworkDeviceStateReasonDcbFoecFailed + \value NetworkDeviceStateReasonTeamdControlFailed + \value NetworkDeviceStateReasonModemFailed + \value NetworkDeviceStateReasonModemAvailable + \value NetworkDeviceStateReasonSimPinIncorrect + \value NetworkDeviceStateReasonNewActivision + \value NetworkDeviceStateReasonParentChanged + \value NetworkDeviceStateReasonParentManagedChanged +*/ + + +/*! \enum guhserver::NetworkDevice::NetworkDeviceType + \value NetworkDeviceTypeUnknown + \value NetworkDeviceTypeEthernet + \value NetworkDeviceTypeWifi + \value NetworkDeviceTypeBluetooth + \value NetworkDeviceTypeOlpcMesh + \value NetworkDeviceTypeWiMax + \value NetworkDeviceTypeModem + \value NetworkDeviceTypeInfiniBand + \value NetworkDeviceTypeBond + \value NetworkDeviceTypeVLan + \value NetworkDeviceTypeAdsl + \value NetworkDeviceTypeBridge + \value NetworkDeviceTypeGeneric + \value NetworkDeviceTypeTeam + \value NetworkDeviceTypeTun + \value NetworkDeviceTypeIpTunnel + \value NetworkDeviceTypeMacVLan + \value NetworkDeviceTypeVXLan + \value NetworkDeviceTypeVEth +*/ + + +/*! \fn void NetworkDevice::deviceChanged(); + This signal will be emitted when the properties of this \l{NetworkDevice} have changed. +*/ + + #include "networkdevice.h" #include "loggingcategories.h" @@ -194,7 +305,7 @@ void NetworkDevice::disconnectDevice() } -/*! Returns the human readable deviceType of this \l{NetworkDevice}. \sa NetworkDeviceType, */ +/*! Returns the human readable device type string of the given \a deviceType. \sa NetworkDeviceType, */ QString NetworkDevice::deviceTypeToString(const NetworkDevice::NetworkDeviceType &deviceType) { QMetaObject metaObject = NetworkDevice::staticMetaObject; @@ -203,7 +314,7 @@ QString NetworkDevice::deviceTypeToString(const NetworkDevice::NetworkDeviceType return QString(metaEnum.valueToKey(deviceType)).remove("NetworkDeviceType"); } -/*! Returns the human readable device state of this \l{NetworkDevice}. \sa NetworkDeviceState, */ +/*! Returns the human readable device state string of the given \a deviceState. \sa NetworkDeviceState, */ QString NetworkDevice::deviceStateToString(const NetworkDevice::NetworkDeviceState &deviceState) { QMetaObject metaObject = NetworkDevice::staticMetaObject; @@ -212,7 +323,7 @@ QString NetworkDevice::deviceStateToString(const NetworkDevice::NetworkDeviceSta return QString(metaEnum.valueToKey(deviceState)); } -/*! Returns the human readable device state reason of this \l{NetworkDevice}. \sa NetworkDeviceStateReason, */ +/*! Returns the human readable device state reason string of the given \a deviceStateReason. \sa NetworkDeviceStateReason, */ QString NetworkDevice::deviceStateReasonToString(const NetworkDevice::NetworkDeviceStateReason &deviceStateReason) { QMetaObject metaObject = NetworkDevice::staticMetaObject; diff --git a/server/networkmanager/wirelessnetworkdevice.cpp b/server/networkmanager/wirelessnetworkdevice.cpp index be41509f..5d7e9960 100644 --- a/server/networkmanager/wirelessnetworkdevice.cpp +++ b/server/networkmanager/wirelessnetworkdevice.cpp @@ -221,12 +221,13 @@ void WirelessNetworkDevice::propertiesChanged(const QVariantMap &properties) setActiveAccessPoint(qdbus_cast(properties.value("ActiveAccessPoint"))); } -QDebug operator<<(QDebug debug, WirelessNetworkDevice *manager) +/*! Writes the given \a device to the given to \a debug. \sa WirelessNetworkDevice, */ +QDebug operator<<(QDebug debug, WirelessNetworkDevice *device) { - debug.nospace() << "WirelessNetworkDevice(" << manager->interface() << ", "; - debug.nospace() << manager->macAddress() << ", "; - debug.nospace() << manager->bitRate() << " [Mb/s], "; - debug.nospace() << manager->deviceStateString() << ") "; + debug.nospace() << "WirelessNetworkDevice(" << device->interface() << ", "; + debug.nospace() << device->macAddress() << ", "; + debug.nospace() << device->bitRate() << " [Mb/s], "; + debug.nospace() << device->deviceStateString() << ") "; return debug; } diff --git a/server/networkmanager/wirelessnetworkdevice.h b/server/networkmanager/wirelessnetworkdevice.h index a783c4fd..35f5eddc 100644 --- a/server/networkmanager/wirelessnetworkdevice.h +++ b/server/networkmanager/wirelessnetworkdevice.h @@ -80,7 +80,7 @@ signals: void stateChanged(const NetworkDeviceState &state); }; -QDebug operator<<(QDebug debug, WirelessNetworkDevice *manager); +QDebug operator<<(QDebug debug, WirelessNetworkDevice *device); }