diff options
author | Robin Burchell <robin.burchell@jollamobile.com> | 2014-07-24 11:56:04 +0000 |
---|---|---|
committer | Robin Burchell <robin+qt@viroteck.net> | 2014-07-27 22:35:43 +0200 |
commit | 28dc9a3a4e3f7b65b55651d25ca1945cac91db7d (patch) | |
tree | 6ff4a43dd1e2c7a4e1b6e8c37704bed9d9aa97de /src | |
parent | 8d483aacad38b668940f3a4cc5d319d6c91edac6 (diff) |
QUPowerDeviceInterface: Remove getProperty helper
Just call QMap::value directly.
Change-Id: Ic108b0585892986448ea7707b6cf7f54502e7e02
Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/systeminfo/linux/qdevicekitservice_linux.cpp | 27 | ||||
-rw-r--r-- | src/systeminfo/linux/qdevicekitservice_linux_p.h | 1 |
2 files changed, 11 insertions, 17 deletions
diff --git a/src/systeminfo/linux/qdevicekitservice_linux.cpp b/src/systeminfo/linux/qdevicekitservice_linux.cpp index 1e27cbcd..0ea14f9b 100644 --- a/src/systeminfo/linux/qdevicekitservice_linux.cpp +++ b/src/systeminfo/linux/qdevicekitservice_linux.cpp @@ -167,59 +167,54 @@ QUPowerDeviceInterface::~QUPowerDeviceInterface() { } -QVariant QUPowerDeviceInterface::getProperty(const QString &property) -{ - return pMap.value(property); -} - quint16 QUPowerDeviceInterface::type() { - return getProperty(QStringLiteral("Type")).toUInt(); + return pMap.value(QStringLiteral("Type")).toUInt(); } bool QUPowerDeviceInterface::isPowerSupply() { - return getProperty(QStringLiteral("PowerSupply")).toBool(); + return pMap.value(QStringLiteral("PowerSupply")).toBool(); } bool QUPowerDeviceInterface::isOnline() { - return getProperty(QStringLiteral("Online")).toBool(); + return pMap.value(QStringLiteral("Online")).toBool(); } double QUPowerDeviceInterface::currentEnergy() { - return getProperty(QStringLiteral("Energy")).toDouble(); + return pMap.value(QStringLiteral("Energy")).toDouble(); } double QUPowerDeviceInterface::energyWhenFull() { - return getProperty(QStringLiteral("EnergyFull")).toDouble(); + return pMap.value(QStringLiteral("EnergyFull")).toDouble(); } double QUPowerDeviceInterface::energyDischargeRate() { - return getProperty(QStringLiteral("EnergyRate")).toDouble(); + return pMap.value(QStringLiteral("EnergyRate")).toDouble(); } double QUPowerDeviceInterface::voltage() { - return getProperty(QStringLiteral("Voltage")).toDouble(); + return pMap.value(QStringLiteral("Voltage")).toDouble(); } qint64 QUPowerDeviceInterface::timeToFull() { - return getProperty(QStringLiteral("TimeToFull")).toUInt(); + return pMap.value(QStringLiteral("TimeToFull")).toUInt(); } double QUPowerDeviceInterface::percentLeft() { - return getProperty(QStringLiteral("Percentage")).toDouble(); + return pMap.value(QStringLiteral("Percentage")).toDouble(); } quint16 QUPowerDeviceInterface::state() { - return getProperty(QStringLiteral("State")).toUInt(); + return pMap.value(QStringLiteral("State")).toUInt(); } void QUPowerDeviceInterface::connectNotify(const QMetaMethod &signal) @@ -302,7 +297,7 @@ void QUPowerDeviceInterface::propRequestFinished(QDBusPendingCallWatcher *call) QString QUPowerDeviceInterface::nativePath() { - return getProperty(QStringLiteral("NativePath")).toString(); + return pMap.value(QStringLiteral("NativePath")).toString(); } QT_END_NAMESPACE diff --git a/src/systeminfo/linux/qdevicekitservice_linux_p.h b/src/systeminfo/linux/qdevicekitservice_linux_p.h index 8adcca35..06e188df 100644 --- a/src/systeminfo/linux/qdevicekitservice_linux_p.h +++ b/src/systeminfo/linux/qdevicekitservice_linux_p.h @@ -112,7 +112,6 @@ protected: void disconnectNotify(const QMetaMethod &signal); private: - QVariant getProperty(const QString &); QVariantMap pMap; private Q_SLOTS: |