update datetime

pull/135/head
Simon Stürz 2016-02-09 18:59:18 +01:00 committed by Michael Zanetti
parent 98bbd65922
commit c0fcf6bea2
1 changed files with 8 additions and 24 deletions

View File

@ -121,7 +121,6 @@ DevicePluginDateTime::DevicePluginDateTime() :
m_currentDateTime = QDateTime(QDate::currentDate(), QTime::currentTime(), m_timeZone);
connect(m_timer, &QTimer::timeout, this, &DevicePluginDateTime::onSecondChanged);
connect(this, &DevicePluginDateTime::configValueChanged, this, &DevicePluginDateTime::onConfigValueChanged);
}
DeviceManager::HardwareResources DevicePluginDateTime::requiredHardware() const
@ -129,21 +128,6 @@ DeviceManager::HardwareResources DevicePluginDateTime::requiredHardware() const
return DeviceManager::HardwareResourceNetworkManager;
}
//QList<ParamType> DevicePluginDateTime::configurationDescription() const
//{
// QList<ParamType> params;
// ParamType timezoneParamType("timezone", QVariant::String, "Europe/Vienna");
// QList<QVariant> allowedValues;
// foreach (QByteArray timeZone, QTimeZone::availableTimeZoneIds()) {
// allowedValues.append(timeZone);
// }
// timezoneParamType.setAllowedValues(allowedValues);
// params.append(timezoneParamType);
// return params;
//}
DeviceManager::DeviceSetupStatus DevicePluginDateTime::setupDevice(Device *device)
{
// check timezone
@ -332,14 +316,14 @@ void DevicePluginDateTime::processGeoLocationData(const QByteArray &data)
qCWarning(dcDateTime) << "failed to request geo location:" << response.value("status");
}
// check timezone
QString timeZone = response.value("timezone").toString();
if (QString(m_timeZone.id()) != timeZone) {
qCWarning(dcDateTime) << "error: configured timezone does not match the discovered timezone";
qCWarning(dcDateTime) << " configured:" << m_timeZone.id();
qCWarning(dcDateTime) << " discovered:" << timeZone;
return;
}
// // check timezone
// QString timeZone = response.value("timezone").toString();
// if (QString(m_timeZone.id()) != timeZone) {
// qCWarning(dcDateTime) << "error: configured timezone does not match the discovered timezone";
// qCWarning(dcDateTime) << " configured:" << m_timeZone.id();
// qCWarning(dcDateTime) << " discovered:" << timeZone;
// return;
// }
qCDebug(dcDateTime) << "---------------------------------------------";
qCDebug(dcDateTime) << "autodetected location for" << response.value("query").toString();