diff --git a/sources/awesome-widget/plugin/awdataengineaggregator.cpp b/sources/awesome-widget/plugin/awdataengineaggregator.cpp index 71c2c73..62bbbda 100644 --- a/sources/awesome-widget/plugin/awdataengineaggregator.cpp +++ b/sources/awesome-widget/plugin/awdataengineaggregator.cpp @@ -123,13 +123,19 @@ void AWDataEngineAggregator::createQueuedConnection() sources = m_dataEngines[dataEngine]->sources(); // reconnect sources for (auto source : sources) { - Plasma::DataContainer *container =m_dataEngines[dataEngine]->containerForSource(source); + Plasma::DataContainer *container + = m_dataEngines[dataEngine]->containerForSource(source); // disconnect old connections first - disconnect(container, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)), - parent(), SLOT(dataUpdated(QString,Plasma::DataEngine::Data))); + disconnect(container, + SIGNAL(dataUpdated(QString, Plasma::DataEngine::Data)), + parent(), + SLOT(dataUpdated(QString, Plasma::DataEngine::Data))); // and now reconnect with Qt::QueuedConnection type - connect(container, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)), - parent(), SLOT(dataUpdated(QString,Plasma::DataEngine::Data)), Qt::QueuedConnection); + connect(container, + SIGNAL(dataUpdated(QString, Plasma::DataEngine::Data)), + parent(), + SLOT(dataUpdated(QString, Plasma::DataEngine::Data)), + Qt::QueuedConnection); } } } diff --git a/sources/awesome-widget/plugin/awupdatehelper.cpp b/sources/awesome-widget/plugin/awupdatehelper.cpp index bd9c59a..37becf3 100644 --- a/sources/awesome-widget/plugin/awupdatehelper.cpp +++ b/sources/awesome-widget/plugin/awupdatehelper.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include "awdebug.h" @@ -145,13 +144,16 @@ void AWUpdateHelper::userReplyOnUpdates(QAbstractButton *button) void AWUpdateHelper::versionReplyRecieved(QNetworkReply *reply, const bool showAnyway) { - qCDebug(LOG_AW) << "Return code" << reply->error() << "with message" - << reply->errorString() << "and show anyway" << showAnyway; + qCDebug(LOG_AW) << "Show message anyway" << showAnyway; + if (reply->error() != QNetworkReply::NoError) { + qCWarning(LOG_AW) << "An error occurs" << reply->error() + << "with message" << reply->errorString(); + return; + } QJsonParseError error; QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error); - if ((reply->error() != QNetworkReply::NoError) - || (error.error != QJsonParseError::NoError)) { + if (error.error != QJsonParseError::NoError) { qCWarning(LOG_AW) << "Parse error" << error.errorString(); return; } diff --git a/sources/awesomewidgets/extquotes.cpp b/sources/awesomewidgets/extquotes.cpp index aead4a3..de54b63 100644 --- a/sources/awesomewidgets/extquotes.cpp +++ b/sources/awesomewidgets/extquotes.cpp @@ -188,15 +188,17 @@ void ExtQuotes::writeConfiguration() const void ExtQuotes::quotesReplyReceived(QNetworkReply *reply) { - qCDebug(LOG_LIB) << "Return code" << reply->error() << "with message" - << reply->errorString(); + if (reply->error() != QNetworkReply::NoError) { + qCWarning(LOG_AW) << "An error occurs" << reply->error() + << "with message" << reply->errorString(); + return; + } m_isRunning = false; QJsonParseError error; QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error); reply->deleteLater(); - if ((reply->error() != QNetworkReply::NoError) - || (error.error != QJsonParseError::NoError)) { + if (error.error != QJsonParseError::NoError) { qCWarning(LOG_LIB) << "Parse error" << error.errorString(); return; } diff --git a/sources/awesomewidgets/extweather.cpp b/sources/awesomewidgets/extweather.cpp index 3035efa..75da21d 100644 --- a/sources/awesomewidgets/extweather.cpp +++ b/sources/awesomewidgets/extweather.cpp @@ -336,15 +336,17 @@ void ExtWeather::writeConfiguration() const void ExtWeather::weatherReplyReceived(QNetworkReply *reply) { - qCDebug(LOG_LIB) << "Return code" << reply->error() << "with message" - << reply->errorString(); + if (reply->error() != QNetworkReply::NoError) { + qCWarning(LOG_AW) << "An error occurs" << reply->error() + << "with message" << reply->errorString(); + return; + } m_isRunning = false; QJsonParseError error; QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error); reply->deleteLater(); - if ((reply->error() != QNetworkReply::NoError) - || (error.error != QJsonParseError::NoError)) { + if (error.error != QJsonParseError::NoError) { qCWarning(LOG_LIB) << "Parse error" << error.errorString(); return; }