mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-08-29 19:59:57 +00:00
implement qcronscheduler, tests update
This commit is contained in:
@ -59,7 +59,7 @@ ExtWeather::ExtWeather(QWidget *parent, const QString filePath)
|
||||
connect(m_manager, SIGNAL(finished(QNetworkReply *)), this,
|
||||
SLOT(weatherReplyReceived(QNetworkReply *)));
|
||||
|
||||
connect(this, SIGNAL(socketActivated()), this, SLOT(sendRequest()));
|
||||
connect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest()));
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ ExtWeather::~ExtWeather()
|
||||
|
||||
disconnect(m_manager, SIGNAL(finished(QNetworkReply *)), this,
|
||||
SLOT(weatherReplyReceived(QNetworkReply *)));
|
||||
disconnect(this, SIGNAL(socketActivated()), this, SLOT(sendRequest()));
|
||||
disconnect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest()));
|
||||
|
||||
m_manager->deleteLater();
|
||||
delete m_providerObject;
|
||||
@ -270,16 +270,9 @@ void ExtWeather::readJsonMap()
|
||||
|
||||
QVariantHash ExtWeather::run()
|
||||
{
|
||||
if ((!isActive()) || (m_isRunning))
|
||||
if (m_isRunning)
|
||||
return m_values;
|
||||
|
||||
if (m_times == 1)
|
||||
sendRequest();
|
||||
|
||||
// update value
|
||||
if (m_times >= interval())
|
||||
m_times = 0;
|
||||
m_times++;
|
||||
startTimer();
|
||||
|
||||
return m_values;
|
||||
}
|
||||
@ -379,12 +372,6 @@ void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
|
||||
}
|
||||
|
||||
|
||||
bool ExtWeather::canRun()
|
||||
{
|
||||
return ((isActive()) && (!m_isRunning) && (socket().isEmpty()));
|
||||
}
|
||||
|
||||
|
||||
void ExtWeather::initProvider()
|
||||
{
|
||||
delete m_providerObject;
|
||||
|
Reference in New Issue
Block a user