Changeset View
Changeset View
Standalone View
Standalone View
src/wirelessdevice.cpp
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | |||||
122 | } | 122 | } | ||
123 | 123 | | |||
124 | int NetworkManager::WirelessDevice::bitRate() const | 124 | int NetworkManager::WirelessDevice::bitRate() const | ||
125 | { | 125 | { | ||
126 | Q_D(const WirelessDevice); | 126 | Q_D(const WirelessDevice); | ||
127 | return d->bitRate; | 127 | return d->bitRate; | ||
128 | } | 128 | } | ||
129 | 129 | | |||
130 | qlonglong NetworkManager::WirelessDevice::lastScan() const | ||||
131 | { | ||||
132 | Q_D(const WirelessDevice); | ||||
133 | return d->lastScan; | ||||
134 | } | ||||
135 | | ||||
130 | NetworkManager::WirelessDevice::Capabilities NetworkManager::WirelessDevice::wirelessCapabilities() const | 136 | NetworkManager::WirelessDevice::Capabilities NetworkManager::WirelessDevice::wirelessCapabilities() const | ||
131 | { | 137 | { | ||
132 | Q_D(const WirelessDevice); | 138 | Q_D(const WirelessDevice); | ||
133 | return d->wirelessCapabilities; | 139 | return d->wirelessCapabilities; | ||
134 | } | 140 | } | ||
135 | 141 | | |||
136 | NetworkManager::AccessPoint::Ptr NetworkManager::WirelessDevice::findAccessPoint(const QString &uni) | 142 | NetworkManager::AccessPoint::Ptr NetworkManager::WirelessDevice::findAccessPoint(const QString &uni) | ||
137 | { | 143 | { | ||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 233 | } else if (property == QLatin1String("Bitrate")) { | |||
228 | bitRate = value.toUInt(); | 234 | bitRate = value.toUInt(); | ||
229 | Q_EMIT q->bitRateChanged(bitRate); | 235 | Q_EMIT q->bitRateChanged(bitRate); | ||
230 | } else if (property == QLatin1String("Mode")) { | 236 | } else if (property == QLatin1String("Mode")) { | ||
231 | mode = q->convertOperationMode(value.toUInt()); | 237 | mode = q->convertOperationMode(value.toUInt()); | ||
232 | Q_EMIT q->modeChanged(mode); | 238 | Q_EMIT q->modeChanged(mode); | ||
233 | } else if (property == QLatin1String("WirelessCapabilities")) { | 239 | } else if (property == QLatin1String("WirelessCapabilities")) { | ||
234 | wirelessCapabilities = q->convertCapabilities(value.toUInt()); | 240 | wirelessCapabilities = q->convertCapabilities(value.toUInt()); | ||
235 | Q_EMIT q->wirelessCapabilitiesChanged(wirelessCapabilities); | 241 | Q_EMIT q->wirelessCapabilitiesChanged(wirelessCapabilities); | ||
242 | } else if (property == QLatin1String("LastScan")) { | ||||
243 | lastScan = value.toLongLong(); | ||||
jgrulich: Don't use QDateTime::currentDateTime() as it might be different from the actual value returned… | |||||
LastScan is in CLOCK_BOOTIME which is complicated to work with. meven: LastScan is in CLOCK_BOOTIME which is complicated to work with.
So I use naively the signal… | |||||
Then cannot you work with it as with qlonglong? It shouldn't matter then if it's in CLOCK_BOOTIME . jgrulich: Then cannot you work with it as with qlonglong? It shouldn't matter then if it's in… | |||||
I need to be able to know the elapsed time since LastScan. So it doesn't matter as long as I manage to get a CLOCK_BOOTIME value for current time. Anyway I am thinking about adding a short util function somewhere to convert CLOCK_BOOTTIME to QDateTime. meven: I need to be able to know the elapsed time since LastScan. So it doesn't matter as long as I… | |||||
244 | Q_EMIT q->lastScanChanged(lastScan); | ||||
236 | } else if (property == QLatin1String("AccessPoints")) { | 245 | } else if (property == QLatin1String("AccessPoints")) { | ||
237 | // TODO use this instead AccessPointAdded/Removed signals? | 246 | // TODO use this instead AccessPointAdded/Removed signals? | ||
238 | } else { | 247 | } else { | ||
239 | DevicePrivate::propertyChanged(property, value); | 248 | DevicePrivate::propertyChanged(property, value); | ||
240 | } | 249 | } | ||
241 | } | 250 | } | ||
242 | 251 | | |||
243 | NetworkManager::WirelessDevice::OperationMode NetworkManager::WirelessDevice::convertOperationMode(uint theirMode) | 252 | NetworkManager::WirelessDevice::OperationMode NetworkManager::WirelessDevice::convertOperationMode(uint theirMode) | ||
Show All 25 Lines |
Don't use QDateTime::currentDateTime() as it might be different from the actual value returned by NetworkManager.