Clean up library inline code warnings

This commit is contained in:
Simon Stürz 2018-10-29 09:47:44 +01:00
parent 34b79e91e1
commit 78146fa48f
3 changed files with 10 additions and 11 deletions

View File

@ -258,8 +258,8 @@ bool NetworkManager::init()
// Init properties
setVersion(m_networkManagerInterface->property("Version").toString());
setState((NetworkManagerState)m_networkManagerInterface->property("State").toUInt());
setConnectivityState((NetworkManagerConnectivityState)m_networkManagerInterface->property("Connectivity").toUInt());
setState(static_cast<NetworkManagerState>(m_networkManagerInterface->property("State").toUInt()));
setConnectivityState(static_cast<NetworkManagerConnectivityState>(m_networkManagerInterface->property("Connectivity").toUInt()));
setNetworkingEnabled(m_networkManagerInterface->property("NetworkingEnabled").toBool());
setWirelessEnabled(m_networkManagerInterface->property("WirelessEnabled").toBool());
@ -486,7 +486,7 @@ void NetworkManager::onPropertiesChanged(const QVariantMap &properties)
setVersion(properties.value("Version").toString());
if (properties.contains("State"))
setState((NetworkManagerState)properties.value("State").toUInt());
setState(static_cast<NetworkManagerState>(properties.value("State").toUInt()));
if (properties.contains("Connectivity"))
setConnectivityState(NetworkManagerConnectivityState(properties.value("Connectivity").toUInt()));

View File

@ -43,8 +43,7 @@
/*! Constructs a new \l{WirelessAccessPoint} with the given dbus \a objectPath and \a parent. */
WirelessAccessPoint::WirelessAccessPoint(const QDBusObjectPath &objectPath, QObject *parent) :
QObject(parent),
m_objectPath(objectPath),
m_securityFlags(0)
m_objectPath(objectPath)
{
QDBusInterface accessPointInterface(NetworkManagerUtils::networkManagerServiceString(), m_objectPath.path(), NetworkManagerUtils::accessPointInterfaceString(), QDBusConnection::systemBus());
if(!accessPointInterface.isValid()) {
@ -56,9 +55,9 @@ WirelessAccessPoint::WirelessAccessPoint(const QDBusObjectPath &objectPath, QObj
setSsid(accessPointInterface.property("Ssid").toString());
setMacAddress(accessPointInterface.property("HwAddress").toString());
setFrequency(accessPointInterface.property("Frequency").toDouble() / 1000);
setSignalStrength(accessPointInterface.property("Strength").toUInt());
setSignalStrength(accessPointInterface.property("Strength").toInt());
setSecurityFlags(WirelessAccessPoint::ApSecurityModes(accessPointInterface.property("WpaFlags").toUInt()));
setIsProtected((bool)accessPointInterface.property("Flags").toUInt());
setIsProtected(static_cast<bool>(accessPointInterface.property("Flags").toUInt()));
QDBusConnection::systemBus().connect(NetworkManagerUtils::networkManagerServiceString(), objectPath.path(), NetworkManagerUtils::accessPointInterfaceString(), "PropertiesChanged", this, SLOT(onPropertiesChanged(QVariantMap)));
}
@ -139,7 +138,7 @@ void WirelessAccessPoint::setSecurityFlags(const WirelessAccessPoint::ApSecurity
void WirelessAccessPoint::onPropertiesChanged(const QVariantMap &properties)
{
if (properties.contains("Strength"))
setSignalStrength(properties.value("Strength").toUInt());
setSignalStrength(properties.value("Strength").toInt());
}

View File

@ -68,9 +68,9 @@ private:
QString m_ssid;
QString m_macAddress;
double m_frequency;
int m_signalStrength;
bool m_isProtected;
WirelessAccessPoint::ApSecurityModes m_securityFlags;
int m_signalStrength = 0;
bool m_isProtected = false;
WirelessAccessPoint::ApSecurityModes m_securityFlags = ApSecurityModeNone;
void setSsid(const QString &ssid);
void setMacAddress(const QString &macAddress);