implement qcronscheduler, tests update

This commit is contained in:
2017-04-28 01:47:42 +03:00
parent 8be4cc6e82
commit 1b4d1d6944
55 changed files with 412 additions and 144 deletions

View File

@ -60,7 +60,7 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString filePath)
connect(m_manager, SIGNAL(finished(QNetworkReply *)), this,
SLOT(quotesReplyReceived(QNetworkReply *)));
connect(this, SIGNAL(socketActivated()), this, SLOT(sendRequest()));
connect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest()));
}
@ -70,7 +70,7 @@ ExtQuotes::~ExtQuotes()
disconnect(m_manager, SIGNAL(finished(QNetworkReply *)), this,
SLOT(quotesReplyReceived(QNetworkReply *)));
disconnect(this, SIGNAL(socketActivated()), this, SLOT(sendRequest()));
disconnect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest()));
m_manager->deleteLater();
delete ui;
@ -128,16 +128,9 @@ void ExtQuotes::readConfiguration()
QVariantHash ExtQuotes::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;
}
@ -254,12 +247,6 @@ void ExtQuotes::sendRequest()
}
bool ExtQuotes::canRun() const
{
return ((isActive()) && (!m_isRunning) && (socket().isEmpty()));
}
void ExtQuotes::initUrl()
{
// init query