From c5f469375f7c7b09f5f5c9a13ca07c6cf7c2b68a Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 11 Jun 2018 07:48:43 +0900 Subject: Connection: InFore/Background -> Fore/BackgroundRequest --- lib/connection.cpp | 6 +++--- lib/connection.h | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/connection.cpp b/lib/connection.cpp index ea74c1c4..a4980140 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -264,8 +264,8 @@ void Connection::sync(int timeout) // Raw string: http://en.cppreference.com/w/cpp/language/string_literal const QString filter { R"({"room": { "timeline": { "limit": 100 } } })" }; - auto job = d->syncJob = - callApi(InBackground, d->data->lastEvent(), filter, timeout); + auto job = d->syncJob = callApi(BackgroundRequest, + d->data->lastEvent(), filter, timeout); connect( job, &SyncJob::success, this, [this, job] { onSyncSuccess(job->takeData()); d->syncJob = nullptr; @@ -586,7 +586,7 @@ SendToDeviceJob* Connection::sendToDevices(const QString& eventType, deviceToEvents.second.toJson()); }); }); - return callApi(InBackground, + return callApi(BackgroundRequest, eventType, generateTxnId(), json); } diff --git a/lib/connection.h b/lib/connection.h index 5bf8e5ac..2f1b0950 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -53,7 +53,7 @@ namespace QMatrixClient * * \sa Connection::callApi */ - enum RunningPolicy { InForeground = 0x0, InBackground = 0x1 }; + enum RunningPolicy { ForegroundRequest = 0x0, BackgroundRequest = 0x1 }; class Connection: public QObject { Q_OBJECT @@ -222,7 +222,7 @@ namespace QMatrixClient { auto job = new JobT(std::forward(jobArgs)...); connect(job, &BaseJob::failure, this, &Connection::requestFailed); - job->start(connectionData(), runningPolicy&InBackground); + job->start(connectionData(), runningPolicy&BackgroundRequest); return job; } @@ -233,7 +233,7 @@ namespace QMatrixClient template JobT* callApi(JobArgTs&&... jobArgs) const { - return callApi(InForeground, + return callApi(ForegroundRequest, std::forward(jobArgs)...); } @@ -278,12 +278,12 @@ namespace QMatrixClient void stopSync(); virtual MediaThumbnailJob* getThumbnail(const QString& mediaId, - QSize requestedSize, RunningPolicy policy = InBackground) const; + QSize requestedSize, RunningPolicy policy = BackgroundRequest) const; MediaThumbnailJob* getThumbnail(const QUrl& url, - QSize requestedSize, RunningPolicy policy = InBackground) const; + QSize requestedSize, RunningPolicy policy = BackgroundRequest) const; MediaThumbnailJob* getThumbnail(const QUrl& url, int requestedWidth, int requestedHeight, - RunningPolicy policy = InBackground) const; + RunningPolicy policy = BackgroundRequest) const; // QIODevice* should already be open UploadContentJob* uploadContent(QIODevice* contentSource, -- cgit v1.2.3