diff --git a/CMakeLists.txt b/CMakeLists.txt index 8db6d8529f..8dc6e20310 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.18) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) include(VERSION.cmake) diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp index 8bae6689ee..04049a1a20 100644 --- a/src/common/syncjournaldb.cpp +++ b/src/common/syncjournaldb.cpp @@ -2055,6 +2055,11 @@ void SyncJournalDb::markVirtualFileForDownloadRecursively(const QByteArray &path query.exec(); } +SyncJournalDb::PinStateInterface::PinStateInterface(SyncJournalDb *db) + : _db(db) +{ +} + Optional SyncJournalDb::PinStateInterface::rawForPath(const QByteArray &path) { QMutexLocker lock(&_db->_mutex); diff --git a/src/common/syncjournaldb.h b/src/common/syncjournaldb.h index 34f19350f4..d13828e89a 100644 --- a/src/common/syncjournaldb.h +++ b/src/common/syncjournaldb.h @@ -286,6 +286,7 @@ class OCSYNC_EXPORT SyncJournalDb : public QObject */ struct OCSYNC_EXPORT PinStateInterface { + PinStateInterface(SyncJournalDb *db); PinStateInterface(const PinStateInterface &) = delete; PinStateInterface(PinStateInterface &&) = delete; diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 91cbde8c58..352c6a1519 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -64,7 +64,7 @@ UpdateUrlDialog *AccountState::updateUrlDialog(const QUrl &newUrl) _updateUrlDialog = UpdateUrlDialog::fromAccount(_account, newUrl, ocApp()->settingsDialog()); - connect(_updateUrlDialog, &UpdateUrlDialog::accepted, this, [=]() { + connect(_updateUrlDialog, &UpdateUrlDialog::accepted, this, [newUrl, this]() { _account->setUrl(newUrl); Q_EMIT _account->wantsAccountSaved(_account.data()); Q_EMIT urlUpdated(); diff --git a/src/gui/newwizard/pages/accountconfiguredwizardpage.cpp b/src/gui/newwizard/pages/accountconfiguredwizardpage.cpp index 005520e92c..e08aadac47 100644 --- a/src/gui/newwizard/pages/accountconfiguredwizardpage.cpp +++ b/src/gui/newwizard/pages/accountconfiguredwizardpage.cpp @@ -64,7 +64,7 @@ AccountConfiguredWizardPage::AccountConfiguredWizardPage( _ui->useVfsRadioButton->setToolTip(tr("The virtual filesystem feature is not available for this installation.")); } - connect(_ui->chooseLocalDirectoryButton, &QToolButton::clicked, this, [=]() { + connect(_ui->chooseLocalDirectoryButton, &QToolButton::clicked, this, [this]() { auto dialog = new QFileDialog(this, tr("Select the local folder"), _ui->localDirectoryLineEdit->text()); dialog->setFileMode(QFileDialog::Directory); dialog->setOption(QFileDialog::ShowDirsOnly); diff --git a/src/gui/newwizard/states/oauthcredentialssetupwizardstate.cpp b/src/gui/newwizard/states/oauthcredentialssetupwizardstate.cpp index 04d816cf17..8e0381fc30 100644 --- a/src/gui/newwizard/states/oauthcredentialssetupwizardstate.cpp +++ b/src/gui/newwizard/states/oauthcredentialssetupwizardstate.cpp @@ -41,7 +41,7 @@ OAuthCredentialsSetupWizardState::OAuthCredentialsSetupWizardState(SetupWizardCo // bring window up top again, as the browser may have been raised in front of it _context->window()->raise(); - auto finish = [=]() { + auto finish = [result, token, refreshToken, this] { switch (result) { case OAuth::Result::LoggedIn: { _context->accountBuilder().setAuthenticationStrategy(new OAuth2AuthenticationStrategy(token, refreshToken)); @@ -64,7 +64,7 @@ OAuthCredentialsSetupWizardState::OAuthCredentialsSetupWizardState(SetupWizardCo if (!_context->accountBuilder().webFingerAuthenticationServerUrl().isEmpty()) { auto *job = Jobs::WebFingerInstanceLookupJobFactory(_context->accessManager(), token).startJob(_context->accountBuilder().serverUrl(), this); - connect(job, &CoreJob::finished, this, [=]() { + connect(job, &CoreJob::finished, this, [finish, job, this]() { if (!job->success()) { Q_EMIT evaluationFailed(QStringLiteral("Failed to look up instances: %1").arg(job->errorMessage())); } else { diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 7febebdb55..d18cff49fb 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -426,7 +426,7 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo( item->_modtime = serverEntry.modtime; item->_size = serverEntry.size; - auto postProcessServerNew = [=]() mutable { + auto postProcessServerNew = [=, this]() mutable { // Turn new remote files into virtual files if the option is enabled. // TODO: move the decision to the backend const auto &opts = _discoveryData->_syncOptions; @@ -546,7 +546,7 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo( // we need to make a request to the server to know that the original file is deleted on the server _pendingAsyncJobs++; auto job = new RequestEtagJob(_discoveryData->_account, _discoveryData->_baseUrl, _discoveryData->_remoteFolder + originalPath, this); - connect(job, &RequestEtagJob::finishedSignal, this, [=]() mutable { + connect(job, &RequestEtagJob::finishedSignal, this, [=, this]() mutable { _pendingAsyncJobs--; QTimer::singleShot(0, _discoveryData, &DiscoveryPhase::scheduleMoreJobs); if (job->httpStatusCode() == 207 ||