mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-13 22:05:48 +00:00
implement qcronscheduler, tests update
This commit is contained in:
@ -50,7 +50,7 @@ ExtNetworkRequest::ExtNetworkRequest(QWidget *parent, const QString filePath)
|
||||
connect(m_manager, SIGNAL(finished(QNetworkReply *)), this,
|
||||
SLOT(networkReplyReceived(QNetworkReply *)));
|
||||
|
||||
connect(this, SIGNAL(socketActivated()), this, SLOT(sendRequest()));
|
||||
connect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest()));
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ ExtNetworkRequest::~ExtNetworkRequest()
|
||||
|
||||
disconnect(m_manager, SIGNAL(finished(QNetworkReply *)), this,
|
||||
SLOT(networkReplyReceived(QNetworkReply *)));
|
||||
disconnect(this, SIGNAL(socketActivated()), this, SLOT(sendRequest()));
|
||||
disconnect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest()));
|
||||
|
||||
m_manager->deleteLater();
|
||||
delete ui;
|
||||
@ -119,16 +119,9 @@ void ExtNetworkRequest::readConfiguration()
|
||||
|
||||
QVariantHash ExtNetworkRequest::run()
|
||||
{
|
||||
if (!canRun())
|
||||
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;
|
||||
}
|
||||
@ -202,12 +195,6 @@ void ExtNetworkRequest::sendRequest()
|
||||
}
|
||||
|
||||
|
||||
bool ExtNetworkRequest::canRun() const
|
||||
{
|
||||
return ((isActive()) && (!m_isRunning) && (socket().isEmpty()));
|
||||
}
|
||||
|
||||
|
||||
void ExtNetworkRequest::initUrl()
|
||||
{
|
||||
m_url = QUrl(m_stringUrl);
|
||||
|
Reference in New Issue
Block a user