diff --git a/src/gui/editlocallyjob.cpp b/src/gui/editlocallyjob.cpp index cf2c108226150..18055d8d6b648 100644 --- a/src/gui/editlocallyjob.cpp +++ b/src/gui/editlocallyjob.cpp @@ -98,16 +98,16 @@ void EditLocallyJob::startTokenRemoteCheck() const auto encodedToken = QString::fromUtf8(QUrl::toPercentEncoding(_token)); // Sanitise the token const auto encodedRelPath = QUrl::toPercentEncoding(_relPath); // Sanitise the relPath - _checkTokenJob.reset(new SimpleApiJob(_accountState->account(), - QStringLiteral("/ocs/v2.php/apps/files/api/v1/openlocaleditor/%1").arg(encodedToken))); + const auto checkTokenJob = new SimpleApiJob(_accountState->account(), + QStringLiteral("/ocs/v2.php/apps/files/api/v1/openlocaleditor/%1").arg(encodedToken)); QUrlQuery params; params.addQueryItem(QStringLiteral("path"), prefixSlashToPath(encodedRelPath)); - _checkTokenJob->addQueryParams(params); - _checkTokenJob->setVerb(SimpleApiJob::Verb::Post); - connect(_checkTokenJob.get(), &SimpleApiJob::resultReceived, this, &EditLocallyJob::remoteTokenCheckResultReceived); + checkTokenJob->addQueryParams(params); + checkTokenJob->setVerb(SimpleApiJob::Verb::Post); + connect(checkTokenJob, &SimpleApiJob::resultReceived, this, &EditLocallyJob::remoteTokenCheckResultReceived); - _checkTokenJob->start(); + checkTokenJob->start(); } void EditLocallyJob::remoteTokenCheckResultReceived(const int statusCode) diff --git a/src/gui/editlocallyjob.h b/src/gui/editlocallyjob.h index 3a4d0ffc351d2..52eddf37047dd 100644 --- a/src/gui/editlocallyjob.h +++ b/src/gui/editlocallyjob.h @@ -106,7 +106,6 @@ private slots: QString _localFilePath; QString _folderRelativePath; Folder *_folderForFile = nullptr; - std::unique_ptr _checkTokenJob; QMetaObject::Connection _syncTerminatedConnection = {}; QVector _folderConnections; };