diff options
author | KitsuneRal <KitsuneRal@users.noreply.github.com> | 2016-06-01 20:58:25 +0900 |
---|---|---|
committer | KitsuneRal <KitsuneRal@users.noreply.github.com> | 2016-06-01 20:58:25 +0900 |
commit | 43ecbf3135687b2e5a5a604a902f992139cce428 (patch) | |
tree | d717d85e8b5d340050c317418e26addf1766a826 /jobs/basejob.cpp | |
parent | d5df4568d34487aea519ae97dd1666927dcfb62b (diff) | |
parent | 46050cd59a7af8cc7d616fab1a80db95dc8b5b35 (diff) | |
download | libquotient-43ecbf3135687b2e5a5a604a902f992139cce428.tar.gz libquotient-43ecbf3135687b2e5a5a604a902f992139cce428.zip |
Merge pull request #9 from Fxrh/code-tweaks
Code tweaks
Diffstat (limited to 'jobs/basejob.cpp')
-rw-r--r-- | jobs/basejob.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index cfdf8a28..50c85048 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; @@ -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() @@ -67,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(); } @@ -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" ); } |