From 316f1ac68cfccd7e304140d75e26bd094db310cb Mon Sep 17 00:00:00 2001 From: nymea Date: Fri, 26 Jul 2019 16:24:59 +0200 Subject: [PATCH] added README --- coinmarketcap/README.md | 4 ++++ coinmarketcap/deviceplugincoinmarketcap.cpp | 23 ++------------------- 2 files changed, 6 insertions(+), 21 deletions(-) create mode 100644 coinmarketcap/README.md diff --git a/coinmarketcap/README.md b/coinmarketcap/README.md new file mode 100644 index 00000000..d4e31513 --- /dev/null +++ b/coinmarketcap/README.md @@ -0,0 +1,4 @@ +#CoinMarketCap + +The coin market cap plugin gets the latest crypto prices from coin market cap and displays it in your favorite fiat currency. + diff --git a/coinmarketcap/deviceplugincoinmarketcap.cpp b/coinmarketcap/deviceplugincoinmarketcap.cpp index bf9a9e51..8f24f6b9 100644 --- a/coinmarketcap/deviceplugincoinmarketcap.cpp +++ b/coinmarketcap/deviceplugincoinmarketcap.cpp @@ -18,23 +18,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/*! - \page coinmarketcap.html - \title coin market cap - \brief Plugin to get the latest crypto prices. - - \ingroup plugins - - The coin market cap plugin gets the latest crypto prices from coin market cap and displays it in your favourite fiat currency. - - \chapter Plugin properties - Following JSON file contains the definition and the description of all available \l{DeviceClass}{DeviceClasses} - and \l{Vendor}{Vendors} of this \l{DevicePlugin}. - - For more details how to read this JSON file please check out the documentation for \l{The plugin JSON File}. - - \quotefile plugins/deviceplugins/coinmarketcap/deviceplugincoinmarketcap.json -*/ #include "deviceplugincoinmarketcap.h" #include "network/networkaccessmanager.h" @@ -85,11 +68,11 @@ void DevicePluginCoinMarketCap::onPluginTimer() void DevicePluginCoinMarketCap::onPriceCallFinished() { QNetworkReply *reply = static_cast(sender()); - qCDebug(dcCoinMarketCap()) << "GET reply finished"; + reply->deleteLater(); + int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); if (!m_httpRequests.contains(reply)) { - reply->deleteLater(); return; } @@ -104,11 +87,9 @@ void DevicePluginCoinMarketCap::onPriceCallFinished() // check JSON file QJsonParseError error; QJsonDocument jsonResponse = QJsonDocument::fromJson(reply->readAll(), &error); - reply->deleteLater(); if (error.error != QJsonParseError::NoError) { qCWarning(dcCoinMarketCap()) << "Update reply JSON error:" << error.errorString(); - reply->deleteLater(); return; }