From 5e6a0b961d1fc2162c5a7498f10bbd1a477f1ece Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 27 May 2016 16:51:13 +0900 Subject: Use nullptr --- jobs/basejob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'jobs/basejob.cpp') diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index cfdf8a28..074a2629 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -31,7 +31,7 @@ class BaseJob::Private { public: Private(ConnectionData* c, JobHttpType t, bool nt) - : connection(c), reply(0), type(t), needsToken(nt) {} + : connection(c), reply(nullptr), type(t), needsToken(nt) {} ConnectionData* connection; QNetworkReply* reply; -- cgit v1.2.3 From 40195a814673fb8557a8b9c67a0f4d61191eb34e Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 11 May 2016 17:42:24 +0900 Subject: Set the object name for each job, to make it clear which job has failed And we don't need two log lines for timeouts. --- jobs/basejob.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jobs/basejob.cpp') diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index 074a2629..e4350306 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -39,7 +39,7 @@ class BaseJob::Private bool needsToken; }; -BaseJob::BaseJob(ConnectionData* connection, JobHttpType type, bool needsToken) +BaseJob::BaseJob(ConnectionData* connection, JobHttpType type, QString name, bool needsToken) : d(new Private(connection, type, needsToken)) { // Work around KJob inability to separate success and failure signals @@ -49,6 +49,7 @@ BaseJob::BaseJob(ConnectionData* connection, JobHttpType type, bool needsToken) else emit failure(this); }); + setObjectName(name); } BaseJob::~BaseJob() @@ -121,7 +122,7 @@ void BaseJob::fail(int errorCode, QString errorString) setErrorText( errorString ); if( d->reply->isRunning() ) d->reply->abort(); - qWarning() << this << "failed:" << errorString; + qWarning() << "Job" << objectName() << "failed:" << errorString; emitResult(); } @@ -155,7 +156,6 @@ void BaseJob::gotReply() void BaseJob::timeout() { - qDebug() << "Timeout!"; fail( TimeoutError, "The job has timed out" ); } -- cgit v1.2.3 From 46050cd59a7af8cc7d616fab1a80db95dc8b5b35 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 25 May 2016 20:37:36 +0900 Subject: Use 'override' keyword throughout job classes; constify apiPath(), query(), data() Thanks to CLang model. --- jobs/basejob.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'jobs/basejob.cpp') diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index e4350306..50c85048 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -68,12 +68,12 @@ ConnectionData* BaseJob::connection() const return d->connection; } -QJsonObject BaseJob::data() +QJsonObject BaseJob::data() const { return QJsonObject(); } -QUrlQuery BaseJob::query() +QUrlQuery BaseJob::query() const { return QUrlQuery(); } -- cgit v1.2.3