From 8e41220a812522d6ba53cf391a0cfc5355043b16 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 26 Jul 2016 13:01:19 +0900 Subject: Log creation/deletion of jobs (especially SyncJob) Due to signal-slot processing it's not obvious when exactly each job object is deleted. --- jobs/basejob.cpp | 2 ++ jobs/syncjob.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 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) -- cgit v1.2.3