fix update weather timer

This commit is contained in:
Simon Stürz 2015-10-25 11:05:30 +01:00 committed by Michael Zanetti
parent 46f77cd67a
commit 1da46acc47

View File

@ -106,6 +106,9 @@ DeviceManager::DeviceSetupStatus DevicePluginOpenweathermap::setupDevice(Device
if (device->deviceClassId() != openweathermapDeviceClassId)
return DeviceManager::DeviceSetupStatusFailure;
if (!m_timer->isActive())
m_timer->start();
update(device);
return DeviceManager::DeviceSetupStatusSuccess;
@ -135,6 +138,9 @@ void DevicePluginOpenweathermap::deviceRemoved(Device *device)
reply->deleteLater();
}
}
if (myDevices().isEmpty())
m_timer->stop();
}
void DevicePluginOpenweathermap::networkManagerReplyReady(QNetworkReply *reply)