gpu support

This commit is contained in:
2024-03-26 10:39:09 +02:00
parent 7b60e8a42f
commit 0b2b58bd33
32 changed files with 115 additions and 1186 deletions

View File

@ -46,9 +46,8 @@ ExtQuotes::ExtQuotes(QObject *_parent, const QString &_filePath)
// HACK declare as child of nullptr to avoid crash with plasmawindowed
// in the destructor
m_manager = new QNetworkAccessManager(nullptr);
connect(m_manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(quotesReplyReceived(QNetworkReply *)));
connect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest()));
connect(m_manager, &QNetworkAccessManager::finished, this, &ExtQuotes::quotesReplyReceived);
connect(this, &ExtQuotes::requestDataUpdate, this, &ExtQuotes::sendRequest);
}
@ -56,8 +55,8 @@ ExtQuotes::~ExtQuotes()
{
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
disconnect(m_manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(quotesReplyReceived(QNetworkReply *)));
disconnect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest()));
disconnect(m_manager, &QNetworkAccessManager::finished, this, &ExtQuotes::quotesReplyReceived);
disconnect(this, &ExtQuotes::requestDataUpdate, this, &ExtQuotes::sendRequest);
m_manager->deleteLater();
}

View File

@ -1,8 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Name=AAPL.NASDAQ
Name=AAPL
Comment=Apple Inc
X-AW-Ticker="AAPL"
X-AW-Ticker="AAPL.US"
X-AW-Active=false
X-AW-ApiVersion=5
X-AW-Interval=60

View File

@ -1,8 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Name=GOOG.NASDAQ
Name=GOOG
Comment=Google Inc
X-AW-Ticker="GOOG"
X-AW-Ticker="GOOG.US"
X-AW-Active=false
X-AW-ApiVersion=5
X-AW-Interval=60

View File

@ -1,8 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Name=MSFT.NASDAQ
Name=MSFT
Comment=Microsoft Corp
X-AW-Ticker="MSFT"
X-AW-Ticker="MSFT.US"
X-AW-Active=false
X-AW-ApiVersion=5
X-AW-Interval=60

View File

@ -54,7 +54,7 @@ QVariantHash StooqQuotesProvider::parse(const QByteArray &_source, const QVarian
QVariantHash values;
QStringList sourceValues = QString::fromUtf8(_source).trimmed().split(',');
auto sourceValues = QString::fromUtf8(_source).trimmed().split(',');
if (sourceValues.count() != 2) {
qCWarning(LOG_LIB) << "Parse error" << sourceValues;
return values;
@ -67,12 +67,12 @@ QVariantHash StooqQuotesProvider::parse(const QByteArray &_source, const QVarian
// last trade
auto price = sourceValues.at(0).toDouble();
values[tag("pricechg")] = oldPrice == 0.0 ? 0.0 : price - oldPrice;
values[tag("percpricechg")] = 100.0 * values[tag("pricechg")].toDouble() / price;
values[tag("percpricechg")] = 100.0 * values[tag("pricechg")].toDouble() / oldPrice;
values[tag("price")] = price;
// volume
auto volume = sourceValues.at(1).toInt();
values[tag("volumechg")] = oldVolume == 0 ? 0 : volume - oldVolume;
values[tag("percvolumechg")] = 100.0 * values[tag("volumechg")].toDouble() / volume;
values[tag("percvolumechg")] = 100.0 * values[tag("volumechg")].toDouble() / oldVolume;
values[tag("volume")] = volume;
return values;