diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/musicbrainz/web/acoustidlookuptask.cpp | 17 | ||||
-rw-r--r-- | src/musicbrainz/web/acoustidlookuptask.h | 4 | ||||
-rw-r--r-- | src/musicbrainz/web/musicbrainzrecordingstask.cpp | 21 | ||||
-rw-r--r-- | src/musicbrainz/web/musicbrainzrecordingstask.h | 6 | ||||
-rw-r--r-- | src/network/jsonwebtask.cpp | 10 | ||||
-rw-r--r-- | src/network/jsonwebtask.h | 18 | ||||
-rw-r--r-- | src/network/webtask.cpp | 4 | ||||
-rw-r--r-- | src/network/webtask.h | 6 |
8 files changed, 43 insertions, 43 deletions
diff --git a/src/musicbrainz/web/acoustidlookuptask.cpp b/src/musicbrainz/web/acoustidlookuptask.cpp index 359000a4f1..9319641f75 100644 --- a/src/musicbrainz/web/acoustidlookuptask.cpp +++ b/src/musicbrainz/web/acoustidlookuptask.cpp @@ -113,19 +113,19 @@ QNetworkReply* AcoustIdLookupTask::sendNetworkRequest( } void AcoustIdLookupTask::onFinished( - network::JsonWebResponse&& response) { + const network::JsonWebResponse& response) { if (!response.isStatusCodeSuccess()) { kLogger.warning() << "Request failed with HTTP status code" << response.statusCode(); - emitFailed(std::move(response)); + emitFailed(response); return; } VERIFY_OR_DEBUG_ASSERT(response.statusCode() == network::kHttpStatusCodeOk) { kLogger.warning() << "Unexpected HTTP status code" << response.statusCode(); - emitFailed(std::move(response)); + emitFailed(response); return; } @@ -133,7 +133,7 @@ void AcoustIdLookupTask::onFinished( kLogger.warning() << "Invalid JSON content" << response.content(); - emitFailed(std::move(response)); + emitFailed(response); return; } const auto jsonObject = response.content().object(); @@ -143,7 +143,7 @@ void AcoustIdLookupTask::onFinished( kLogger.warning() << "Unexpected response status" << statusText; - emitFailed(std::move(response)); + emitFailed(response); return; } @@ -207,11 +207,11 @@ void AcoustIdLookupTask::onFinished( } } } - emitSucceeded(std::move(recordingIds)); + emitSucceeded(recordingIds); } void AcoustIdLookupTask::emitSucceeded( - QList<QUuid>&& recordingIds) { + const QList<QUuid>& recordingIds) { VERIFY_OR_DEBUG_ASSERT( isSignalFuncConnected(&AcoustIdLookupTask::succeeded)) { kLogger.warning() @@ -219,8 +219,7 @@ void AcoustIdLookupTask::emitSucceeded( deleteLater(); return; } - emit succeeded( - std::move(recordingIds)); + emit succeeded(recordingIds); } } // namespace mixxx diff --git a/src/musicbrainz/web/acoustidlookuptask.h b/src/musicbrainz/web/acoustidlookuptask.h index 75e9b827f5..74317b8c10 100644 --- a/src/musicbrainz/web/acoustidlookuptask.h +++ b/src/musicbrainz/web/acoustidlookuptask.h @@ -32,10 +32,10 @@ class AcoustIdLookupTask : public network::JsonWebTask { private: void onFinished( - network::JsonWebResponse&& response) override; + const network::JsonWebResponse& response) override; void emitSucceeded( - QList<QUuid>&& recordingIds); + const QList<QUuid>& recordingIds); const QUrlQuery m_urlQuery; }; diff --git a/src/musicbrainz/web/musicbrainzrecordingstask.cpp b/src/musicbrainz/web/musicbrainzrecordingstask.cpp index 3384f1630c..77b14ba9ee 100644 --- a/src/musicbrainz/web/musicbrainzrecordingstask.cpp +++ b/src/musicbrainz/web/musicbrainzrecordingstask.cpp @@ -71,7 +71,7 @@ MusicBrainzRecordingsTask::MusicBrainzRecordingsTask( : network::WebTask( networkAccessManager, parent), - m_queuedRecordingIds(std::move(recordingIds)), + m_queuedRecordingIds(recordingIds), m_parentTimeoutMillis(0) { musicbrainz::registerMetaTypesOnce(); } @@ -129,7 +129,7 @@ void MusicBrainzRecordingsTask::doNetworkReplyFinished( finishedNetworkReply->request().url(), statusCode), error.code, - std::move(error.message)); + error.message); return; } @@ -151,7 +151,7 @@ void MusicBrainzRecordingsTask::doNetworkReplyFinished( finishedNetworkReply->request().url(), statusCode), -1, - "Failed to parse XML response"); + QStringLiteral("Failed to parse XML response")); return; } @@ -160,7 +160,7 @@ void MusicBrainzRecordingsTask::doNetworkReplyFinished( m_finishedRecordingIds.clear(); auto trackReleases = m_trackReleases.values(); m_trackReleases.clear(); - emitSucceeded(std::move(trackReleases)); + emitSucceeded(trackReleases); return; } @@ -170,7 +170,7 @@ void MusicBrainzRecordingsTask::doNetworkReplyFinished( } void MusicBrainzRecordingsTask::emitSucceeded( - QList<musicbrainz::TrackRelease>&& trackReleases) { + const QList<musicbrainz::TrackRelease>& trackReleases) { VERIFY_OR_DEBUG_ASSERT( isSignalFuncConnected(&MusicBrainzRecordingsTask::succeeded)) { kLogger.warning() @@ -178,14 +178,13 @@ void MusicBrainzRecordingsTask::emitSucceeded( deleteLater(); return; } - emit succeeded( - std::move(trackReleases)); + emit succeeded(trackReleases); } void MusicBrainzRecordingsTask::emitFailed( - network::WebResponse&& response, + const network::WebResponse& response, int errorCode, - QString&& errorMessage) { + const QString& errorMessage) { VERIFY_OR_DEBUG_ASSERT( isSignalFuncConnected(&MusicBrainzRecordingsTask::failed)) { kLogger.warning() @@ -197,9 +196,9 @@ void MusicBrainzRecordingsTask::emitFailed( return; } emit failed( - std::move(response), + response, errorCode, - std::move(errorMessage)); + errorMessage); } } // namespace mixxx diff --git a/src/musicbrainz/web/musicbrainzrecordingstask.h b/src/musicbrainz/web/musicbrainzrecordingstask.h index 39678d65ff..3a8451745d 100644 --- a/src/musicbrainz/web/musicbrainzrecordingstask.h +++ b/src/musicbrainz/web/musicbrainzrecordingstask.h @@ -38,11 +38,11 @@ class MusicBrainzRecordingsTask : public network::WebTask { network::HttpStatusCode statusCode) override; void emitSucceeded( - QList<musicbrainz::TrackRelease>&& trackReleases); + const QList<musicbrainz::TrackRelease>& trackReleases); void emitFailed( - network::WebResponse&& response, + const network::WebResponse& response, int errorCode, - QString&& errorMessage); + const QString& errorMessage); void continueWithNextRequest(); diff --git a/src/network/jsonwebtask.cpp b/src/network/jsonwebtask.cpp index f33a7cea0f..434ab27081 100644 --- a/src/network/jsonwebtask.cpp +++ b/src/network/jsonwebtask.cpp @@ -119,13 +119,13 @@ JsonWebTask::JsonWebTask( QObject* parent) : WebTask(networkAccessManager, parent), m_baseUrl(std::move(baseUrl)), - m_request(std::move(request)) { + m_request(request) { std::call_once(registerMetaTypesOnceFlag, registerMetaTypesOnce); DEBUG_ASSERT(!m_baseUrl.isEmpty()); } void JsonWebTask::onFinished( - JsonWebResponse&& jsonResponse) { + const JsonWebResponse& jsonResponse) { kLogger.info() << this << "Received JSON response" @@ -134,7 +134,7 @@ void JsonWebTask::onFinished( } void JsonWebTask::onFinishedCustom( - WebResponseWithContent&& customResponse) { + const WebResponseWithContent& customResponse) { kLogger.info() << this << "Received custom response" @@ -285,7 +285,7 @@ void JsonWebTask::doNetworkReplyFinished( } void JsonWebTask::emitFailed( - network::JsonWebResponse&& response) { + const network::JsonWebResponse& response) { VERIFY_OR_DEBUG_ASSERT( isSignalFuncConnected(&JsonWebTask::failed)) { kLogger.warning() @@ -295,7 +295,7 @@ void JsonWebTask::emitFailed( deleteLater(); return; } - emit failed(std::move(response)); + emit failed(response); } } // namespace network diff --git a/src/network/jsonwebtask.h b/src/network/jsonwebtask.h index cd3f89f137..916be0cc99 100644 --- a/src/network/jsonwebtask.h +++ b/src/network/jsonwebtask.h @@ -33,8 +33,8 @@ class JsonWebResponse final { JsonWebResponse( WebResponse&& response, QJsonDocument&& content) - : m_response(std::move(response)), - m_content(std::move(content)) { + : m_response(response), + m_content(content) { } JsonWebResponse(const JsonWebResponse&) = default; JsonWebResponse(JsonWebResponse&&) = default; @@ -89,16 +89,18 @@ class JsonWebTask : public WebTask { const QJsonDocument& content); void emitFailed( - network::JsonWebResponse&& response); + const network::JsonWebResponse& response); private: - // Handle the response and ensure that the task eventually - // gets deleted. The default implementation discards the - // response and deletes the task. + /// Handle the response and ensure that the task eventually + /// gets deleted. + /// + /// Could be overridden by derived classes. The default + /// implementation discards the response and deletes the task. virtual void onFinished( - JsonWebResponse&& response); + const JsonWebResponse& jsonResponse); virtual void onFinishedCustom( - WebResponseWithContent&& response); + const WebResponseWithContent& customResponse); QNetworkReply* doStartNetworkRequest( QNetworkAccessManager* networkAccessManager, diff --git a/src/network/webtask.cpp b/src/network/webtask.cpp index af3329beaa..30d910b800 100644 --- a/src/network/webtask.cpp +++ b/src/network/webtask.cpp @@ -141,7 +141,7 @@ void WebTask::onNetworkError( DEBUG_ASSERT(hasTerminated()); if (m_state == State::Aborted) { - emitAborted(responseWithContent.replyUrl()); + emitAborted(responseWithContent.requestUrl()); } else { emitNetworkError( errorCode, @@ -214,7 +214,7 @@ void WebTask::slotStart(int timeoutMillis) { << this << "Network request has not been started"; m_state = State::Aborted; - emitAborted(); + emitAborted(/*request URL is unknown*/); return; } diff --git a/src/network/webtask.h b/src/network/webtask.h index ae2e8ed654..cc03479a6f 100644 --- a/src/network/webtask.h +++ b/src/network/webtask.h @@ -69,9 +69,9 @@ class WebResponseWithContent final { WebResponse&& response, QMimeType&& contentType, QByteArray&& contentData) - : m_response(std::move(response)), - m_contentType(std::move(contentType)), - m_contentData(std::move(contentData)) { + : m_response(response), + m_contentType(contentType), + m_contentData(contentData) { } WebResponseWithContent(const WebResponseWithContent&) = default; WebResponseWithContent(WebResponseWithContent&&) = default; |