mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-12-16 10:03:40 +00:00
initial support of weather
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user