diff options
Diffstat (limited to 'jobs')
-rw-r--r-- | jobs/basejob.cpp | 17 | ||||
-rw-r--r-- | jobs/joinroomjob.cpp | 3 | ||||
-rw-r--r-- | jobs/mediathumbnailjob.cpp | 3 | ||||
-rw-r--r-- | jobs/postmessagejob.cpp | 3 | ||||
-rw-r--r-- | jobs/roommessagesjob.cpp | 2 | ||||
-rw-r--r-- | jobs/syncjob.cpp | 4 |
6 files changed, 18 insertions, 14 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index 226290ff..3e2ecd54 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -17,6 +17,7 @@ */ #include "basejob.h" +#include "util.h" #include <array> @@ -86,13 +87,13 @@ BaseJob::BaseJob(ConnectionData* connection, HttpVerb verb, QString name, connect (&d->timer, &QTimer::timeout, this, &BaseJob::timeout); d->retryTimer.setSingleShot(true); connect (&d->retryTimer, &QTimer::timeout, this, &BaseJob::start); - qDebug() << this << "created"; + qCDebug(JOBS) << this << "created"; } BaseJob::~BaseJob() { stop(); - qDebug() << this << "destroyed"; + qCDebug(JOBS) << this << "destroyed"; } ConnectionData* BaseJob::connection() const @@ -174,7 +175,7 @@ void BaseJob::gotReply() BaseJob::Status BaseJob::checkReply(QNetworkReply* reply) const { if (reply->error() != QNetworkReply::NoError) - qDebug() << this << "returned" << reply->error(); + qCDebug(JOBS) << this << "returned" << reply->error(); switch( reply->error() ) { case QNetworkReply::NoError: @@ -217,11 +218,11 @@ void BaseJob::stop() d->timer.stop(); if (!d->reply) { - qWarning() << this << "stopped with empty network reply"; + qCWarning(JOBS) << this << "stopped with empty network reply"; } else if (d->reply->isRunning()) { - qWarning() << this << "stopped without ready network reply"; + qCWarning(JOBS) << this << "stopped without ready network reply"; d->reply->disconnect(this); // Ignore whatever comes from the reply d->reply->abort(); } @@ -235,7 +236,7 @@ void BaseJob::finishJob() { const auto retryInterval = getNextRetryInterval(); ++d->retriesTaken; - qWarning() << this << "will take retry" << d->retriesTaken + qCWarning(JOBS) << this << "will take retry" << d->retriesTaken << "in" << retryInterval/1000 << "s"; d->retryTimer.start(retryInterval); emit retryScheduled(d->retriesTaken, retryInterval); @@ -301,7 +302,7 @@ void BaseJob::setStatus(Status s) d->status = s; if (!s.good()) { - qWarning() << this << "status" << s.code << ":" << s.message; + qCWarning(JOBS) << this << "status" << s.code << ":" << s.message; } } @@ -324,7 +325,7 @@ void BaseJob::timeout() void BaseJob::sslErrors(const QList<QSslError>& errors) { foreach (const QSslError &error, errors) { - qWarning() << "SSL ERROR" << error.errorString(); + qCWarning(JOBS) << "SSL ERROR" << error.errorString(); } d->reply->ignoreSslErrors(); // TODO: insecure! should prompt user first } diff --git a/jobs/joinroomjob.cpp b/jobs/joinroomjob.cpp index a6f65c31..dce1f54e 100644 --- a/jobs/joinroomjob.cpp +++ b/jobs/joinroomjob.cpp @@ -17,6 +17,7 @@ */ #include "joinroomjob.h" +#include "util.h" #include <QtNetwork/QNetworkReply> @@ -56,6 +57,6 @@ BaseJob::Status JoinRoomJob::parseJson(const QJsonDocument& data) return Success; } - qDebug() << data; + qCDebug(JOBS) << data; return { UserDefinedError, "No room_id in the JSON response" }; } diff --git a/jobs/mediathumbnailjob.cpp b/jobs/mediathumbnailjob.cpp index fdee8f47..cfde902a 100644 --- a/jobs/mediathumbnailjob.cpp +++ b/jobs/mediathumbnailjob.cpp @@ -17,6 +17,7 @@ */ #include "mediathumbnailjob.h" +#include "util.h" #include <QtCore/QDebug> @@ -55,7 +56,7 @@ BaseJob::Status MediaThumbnailJob::parseReply(QByteArray data) { if( !d->thumbnail.loadFromData(data) ) { - qDebug() << "MediaThumbnailJob: could not read image data"; + qCDebug(JOBS) << "MediaThumbnailJob: could not read image data"; } return Success; } diff --git a/jobs/postmessagejob.cpp b/jobs/postmessagejob.cpp index 69cc814d..9a102325 100644 --- a/jobs/postmessagejob.cpp +++ b/jobs/postmessagejob.cpp @@ -18,6 +18,7 @@ #include "postmessagejob.h" #include "../connectiondata.h" +#include "util.h" #include <QtNetwork/QNetworkReply> @@ -62,6 +63,6 @@ BaseJob::Status PostMessageJob::parseJson(const QJsonDocument& data) if( data.object().contains("event_id") ) return Success; - qDebug() << data; + qCDebug(JOBS) << data; return { UserDefinedError, "No event_id in the JSON response" }; } diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp index 6443217b..5779d695 100644 --- a/jobs/roommessagesjob.cpp +++ b/jobs/roommessagesjob.cpp @@ -43,7 +43,7 @@ RoomMessagesJob::RoomMessagesJob(ConnectionData* data, QString roomId, })) , d(new Private) { - qDebug() << "Room messages query:" << query().toString(QUrl::PrettyDecoded); + qCDebug(JOBS) << "Room messages query:" << query().toString(QUrl::PrettyDecoded); } RoomMessagesJob::~RoomMessagesJob() diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp index b3724dff..8db1e2ca 100644 --- a/jobs/syncjob.cpp +++ b/jobs/syncjob.cpp @@ -123,7 +123,7 @@ SyncRoomData::SyncRoomData(QString roomId_, JoinState joinState_, const QJsonObj timeline.fromJson(room_); break; default: - qWarning() << "SyncRoomData: Unknown JoinState value, ignoring:" << int(joinState); + qCWarning(JOBS) << "SyncRoomData: Unknown JoinState value, ignoring:" << int(joinState); } QJsonObject timeline = room_.value("timeline").toObject(); @@ -133,5 +133,5 @@ SyncRoomData::SyncRoomData(QString roomId_, JoinState joinState_, const QJsonObj QJsonObject unread = room_.value("unread_notifications").toObject(); highlightCount = unread.value("highlight_count").toInt(); notificationCount = unread.value("notification_count").toInt(); - qDebug() << "Highlights: " << highlightCount << " Notifications:" << notificationCount; + qCDebug(JOBS) << "Highlights: " << highlightCount << " Notifications:" << notificationCount; } |