diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-07-26 13:01:19 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-07-26 13:01:19 +0900 |
commit | 8e41220a812522d6ba53cf391a0cfc5355043b16 (patch) | |
tree | ad70878594b46fd10b691bc6013251b8a3c1cf51 | |
parent | 4134fa4133aedc824bcedc11402805773a2c6144 (diff) | |
download | libquotient-8e41220a812522d6ba53cf391a0cfc5355043b16.tar.gz libquotient-8e41220a812522d6ba53cf391a0cfc5355043b16.zip |
Log creation/deletion of jobs (especially SyncJob)
Due to signal-slot processing it's not obvious when exactly each job object is deleted.
-rw-r--r-- | jobs/basejob.cpp | 2 | ||||
-rw-r--r-- | jobs/syncjob.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index 2177fe9c..6c68ab66 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -50,6 +50,7 @@ BaseJob::BaseJob(ConnectionData* connection, JobHttpType type, QString name, boo emit failure(this); }); setObjectName(name); + qDebug() << "Job" << objectName() << " created"; } BaseJob::~BaseJob() @@ -61,6 +62,7 @@ BaseJob::~BaseJob() d->reply->deleteLater(); } delete d; + qDebug() << "Job" << objectName() << " destroyed"; } ConnectionData* BaseJob::connection() const diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp index 37f79298..3a7573bc 100644 --- a/jobs/syncjob.cpp +++ b/jobs/syncjob.cpp @@ -43,8 +43,10 @@ class SyncJob::Private QList<SyncRoomData> roomData; }; +static size_t jobId = 0; + SyncJob::SyncJob(ConnectionData* connection, QString since) - : BaseJob(connection, JobHttpType::GetJob, "SyncJob") + : BaseJob(connection, JobHttpType::GetJob, QString("SyncJob-%1").arg(++jobId)) , d(new Private) { d->since = since; @@ -133,6 +135,7 @@ void SyncJob::parseJson(const QJsonDocument& data) } emitResult(); + qDebug() << objectName() << ": processing complete"; } void SyncRoomData::EventList::fromJson(const QJsonObject& roomContents) |