aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'jobs')
-rw-r--r--jobs/basejob.cpp6
-rw-r--r--jobs/basejob.h3
-rw-r--r--jobs/checkauthmethods.cpp4
-rw-r--r--jobs/joinroomjob.cpp2
-rw-r--r--jobs/leaveroomjob.cpp2
-rw-r--r--jobs/mediathumbnailjob.cpp2
-rw-r--r--jobs/passwordlogin.cpp2
-rw-r--r--jobs/postmessagejob.cpp4
-rw-r--r--jobs/postreceiptjob.cpp2
-rw-r--r--jobs/roommembersjob.cpp4
-rw-r--r--jobs/roommessagesjob.cpp2
-rw-r--r--jobs/syncjob.cpp2
12 files changed, 18 insertions, 17 deletions
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" );
}
diff --git a/jobs/basejob.h b/jobs/basejob.h
index f1ad66d1..bb3f42d4 100644
--- a/jobs/basejob.h
+++ b/jobs/basejob.h
@@ -40,7 +40,8 @@ namespace QMatrixClient
{
Q_OBJECT
public:
- BaseJob(ConnectionData* connection, JobHttpType type, bool needsToken=true);
+ BaseJob(ConnectionData* connection, JobHttpType type,
+ QString name, bool needsToken=true);
virtual ~BaseJob();
void start() override;
diff --git a/jobs/checkauthmethods.cpp b/jobs/checkauthmethods.cpp
index 18b5f9a5..0554f749 100644
--- a/jobs/checkauthmethods.cpp
+++ b/jobs/checkauthmethods.cpp
@@ -37,7 +37,7 @@ class CheckAuthMethods::Private
};
CheckAuthMethods::CheckAuthMethods(ConnectionData* connection)
- : BaseJob(connection, JobHttpType::GetJob, false)
+ : BaseJob(connection, JobHttpType::GetJob, "CheckAuthMethods", false)
, d(new Private)
{
}
@@ -60,4 +60,4 @@ QString CheckAuthMethods::apiPath()
void CheckAuthMethods::parseJson(const QJsonDocument& data)
{
// TODO
-} \ No newline at end of file
+}
diff --git a/jobs/joinroomjob.cpp b/jobs/joinroomjob.cpp
index 85a331fa..1001cd10 100644
--- a/jobs/joinroomjob.cpp
+++ b/jobs/joinroomjob.cpp
@@ -33,7 +33,7 @@ class JoinRoomJob::Private
};
JoinRoomJob::JoinRoomJob(ConnectionData* data, QString roomAlias)
- : BaseJob(data, JobHttpType::PostJob)
+ : BaseJob(data, JobHttpType::PostJob, "JoinRoomJob")
, d(new Private)
{
d->roomAlias = roomAlias;
diff --git a/jobs/leaveroomjob.cpp b/jobs/leaveroomjob.cpp
index 1adab31f..4960a9df 100644
--- a/jobs/leaveroomjob.cpp
+++ b/jobs/leaveroomjob.cpp
@@ -34,7 +34,7 @@ class LeaveRoomJob::Private
};
LeaveRoomJob::LeaveRoomJob(ConnectionData* data, Room* room)
- : BaseJob(data, JobHttpType::PostJob)
+ : BaseJob(data, JobHttpType::PostJob, "LeaveRoomJob")
, d(new Private(room))
{
}
diff --git a/jobs/mediathumbnailjob.cpp b/jobs/mediathumbnailjob.cpp
index 02d9bbd9..b7d34bf2 100644
--- a/jobs/mediathumbnailjob.cpp
+++ b/jobs/mediathumbnailjob.cpp
@@ -34,7 +34,7 @@ class MediaThumbnailJob::Private
MediaThumbnailJob::MediaThumbnailJob(ConnectionData* data, QUrl url, int requestedWidth, int requestedHeight,
ThumbnailType thumbnailType)
- : BaseJob(data, JobHttpType::GetJob)
+ : BaseJob(data, JobHttpType::GetJob, "MediaThumbnailJob")
, d(new Private)
{
d->url = url;
diff --git a/jobs/passwordlogin.cpp b/jobs/passwordlogin.cpp
index 6cf45b26..e8a6e5b4 100644
--- a/jobs/passwordlogin.cpp
+++ b/jobs/passwordlogin.cpp
@@ -39,7 +39,7 @@ class PasswordLogin::Private
};
PasswordLogin::PasswordLogin(ConnectionData* connection, QString user, QString password)
- : BaseJob(connection, JobHttpType::PostJob, false)
+ : BaseJob(connection, JobHttpType::PostJob, "PasswordLogin", false)
, d(new Private)
{
d->user = user;
diff --git a/jobs/postmessagejob.cpp b/jobs/postmessagejob.cpp
index 67c79669..65042ed0 100644
--- a/jobs/postmessagejob.cpp
+++ b/jobs/postmessagejob.cpp
@@ -35,7 +35,7 @@ class PostMessageJob::Private
};
PostMessageJob::PostMessageJob(ConnectionData* connection, Room* room, QString type, QString message)
- : BaseJob(connection, JobHttpType::PostJob)
+ : BaseJob(connection, JobHttpType::PostJob, "PostMessageJob")
, d(new Private)
{
d->type = type;
@@ -71,4 +71,4 @@ void PostMessageJob::parseJson(const QJsonDocument& data)
return;
}
emitResult();
-} \ No newline at end of file
+}
diff --git a/jobs/postreceiptjob.cpp b/jobs/postreceiptjob.cpp
index c26186e8..54220626 100644
--- a/jobs/postreceiptjob.cpp
+++ b/jobs/postreceiptjob.cpp
@@ -34,7 +34,7 @@ class PostReceiptJob::Private
};
PostReceiptJob::PostReceiptJob(ConnectionData* connection, QString roomId, QString eventId)
- : BaseJob(connection, JobHttpType::PostJob)
+ : BaseJob(connection, JobHttpType::PostJob, "PostReceiptJob")
, d(new Private)
{
d->roomId = roomId;
diff --git a/jobs/roommembersjob.cpp b/jobs/roommembersjob.cpp
index e12bc6c4..6f1dabb7 100644
--- a/jobs/roommembersjob.cpp
+++ b/jobs/roommembersjob.cpp
@@ -34,7 +34,7 @@ class RoomMembersJob::Private
};
RoomMembersJob::RoomMembersJob(ConnectionData* data, Room* room)
- : BaseJob(data, JobHttpType::GetJob)
+ : BaseJob(data, JobHttpType::GetJob, "RoomMembersJob")
, d(new Private)
{
d->room = room;
@@ -67,4 +67,4 @@ void RoomMembersJob::parseJson(const QJsonDocument& data)
}
qDebug() << "States: " << d->states.count();
emitResult();
-} \ No newline at end of file
+}
diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp
index 5a97cc23..7db98a87 100644
--- a/jobs/roommessagesjob.cpp
+++ b/jobs/roommessagesjob.cpp
@@ -40,7 +40,7 @@ class RoomMessagesJob::Private
};
RoomMessagesJob::RoomMessagesJob(ConnectionData* data, Room* room, QString from, FetchDirectory dir, int limit)
- : BaseJob(data, JobHttpType::GetJob)
+ : BaseJob(data, JobHttpType::GetJob, "RoomMessagesJob")
{
d = new Private();
d->room = room;
diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp
index 6b8ec510..04299b2c 100644
--- a/jobs/syncjob.cpp
+++ b/jobs/syncjob.cpp
@@ -44,7 +44,7 @@ class SyncJob::Private
};
SyncJob::SyncJob(ConnectionData* connection, QString since)
- : BaseJob(connection, JobHttpType::GetJob)
+ : BaseJob(connection, JobHttpType::GetJob, "SyncJob")
, d(new Private)
{
d->since = since;