initial support of weather

This commit is contained in:
arcan1s
2015-07-22 00:44:39 +03:00
parent a065e96bc3
commit b699095f38
21 changed files with 1220 additions and 62 deletions

View File

@ -28,11 +28,13 @@
#include <QTime>
#include <pdebug/pdebug.h>
#include <qreplytimeout/qreplytimeout.h>
#include "version.h"
ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName, const QStringList directories, const bool debugCmd)
ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName,
const QStringList directories, const bool debugCmd)
: QDialog(parent),
m_fileName(quotesName),
m_dirs(directories),
@ -326,6 +328,7 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
if (debug) qDebug() << PDEBUG << ":" << "Return code" << reply->error();
if (debug) qDebug() << PDEBUG << ":" << "Reply error message" << reply->errorString();
isRunning = false;
QJsonParseError error;
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error);
reply->deleteLater();
@ -355,8 +358,6 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
values[QString("pricechg")] = values[QString("price")] == 0 ? 0.0 : value - values[QString("price")];
values[QString("percpricechg")] = 100 * values[QString("pricechg")] / values[QString("price")];
values[QString("price")] = value;
isRunning = false;
}