From 1da46acc47ddfa1b68b60d614a70b9695bebab7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Sun, 25 Oct 2015 11:05:30 +0100 Subject: [PATCH] fix update weather timer --- .../openweathermap/devicepluginopenweathermap.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp b/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp index e5db68ea..3681d77c 100644 --- a/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp +++ b/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp @@ -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)