Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci/clarify deprecated lambda capture warnings #7984

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OSX deployment version")
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED 20)

include(FeatureSummary)

Expand Down
2 changes: 1 addition & 1 deletion src/gui/accountstate.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* Copyright (C) by Daniel Molkentin <[email protected]>
*
Expand Down Expand Up @@ -78,7 +78,7 @@
_termsOfServiceChecker.start();
});

connect(this, &AccountState::isConnectedChanged, [=]{
connect(this, &AccountState::isConnectedChanged, [=, this]{
// Get the Apps available on the server if we're now connected.
if (isConnected()) {
fetchNavigationApps();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/conflictdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ ConflictDialog::ConflictDialog(QWidget *parent)
_ui->conflictMessage->setTextFormat(Qt::PlainText);

connect(_ui->localVersionRadio, &QCheckBox::toggled, this, &ConflictDialog::updateButtonStates);
connect(_ui->localVersionButton, &QToolButton::clicked, this, [=] {
connect(_ui->localVersionButton, &QToolButton::clicked, this, [=, this] {
QDesktopServices::openUrl(QUrl::fromLocalFile(_solver->localVersionFilename()));
});

connect(_ui->remoteVersionRadio, &QCheckBox::toggled, this, &ConflictDialog::updateButtonStates);
connect(_ui->remoteVersionButton, &QToolButton::clicked, this, [=] {
connect(_ui->remoteVersionButton, &QToolButton::clicked, this, [=, this] {
QDesktopServices::openUrl(QUrl::fromLocalFile(_solver->remoteVersionFilename()));
});

Expand Down
2 changes: 1 addition & 1 deletion src/gui/conflictsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bool ConflictSolver::renameLocalVersion()
return false;
}

const auto renamePattern = [=] {
const auto renamePattern = [=, this] {
auto result = QString::fromUtf8(OCC::Utility::conflictFileBaseNameFromPattern(_localVersionFilename.toUtf8()));
const auto dotIndex = result.lastIndexOf('.');
return QString(result.left(dotIndex) + "_%1" + result.mid(dotIndex));
Expand Down
2 changes: 1 addition & 1 deletion src/gui/ignorelisteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* for more details.
*/

#include "configfile.h"

Check failure on line 15 in src/gui/ignorelisteditor.cpp

View workflow job for this annotation

GitHub Actions / build

'configfile.h' file not found

#include "folderman.h"
#include "generalsettings.h"
Expand Down Expand Up @@ -45,7 +45,7 @@
const auto userConfig = cfgFile.excludeFile(ConfigFile::Scope::UserScope);
ui->ignoreTableWidget->readIgnoreFile(userConfig);

connect(this, &QDialog::accepted, [=]() {
connect(this, &QDialog::accepted, [=, this]() {
ui->ignoreTableWidget->slotWriteIgnoreFile(userConfig);
/* handle the hidden file checkbox */

Expand Down
2 changes: 1 addition & 1 deletion src/gui/remotewipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RemoteWipe::RemoteWipe(AccountPtr account, QObject *parent)
_networkManager(nullptr)
{
QObject::connect(AccountManager::instance(), &AccountManager::accountRemoved,
this, [=](AccountState *) {
this, [=, this](AccountState *) {
_accountRemoved = true;
});
if (FolderMan::instance()) {
Expand Down
2 changes: 1 addition & 1 deletion src/gui/sharemanager.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* Copyright (C) by Roeland Jago Douma <[email protected]>
*
Expand Down Expand Up @@ -461,7 +461,7 @@
auto job = new OcsShareJob(_account);
connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
connect(job, &OcsShareJob::shareJobFinished, this,
[=](const QJsonDocument &reply) {
[=, this](const QJsonDocument &reply) {
// Find existing share permissions (if this was shared with us)
Share::Permissions existingPermissions = SharePermissionAll;
for (const auto &element : reply.object()["ocs"].toObject()["data"].toArray()) {
Expand Down
2 changes: 1 addition & 1 deletion src/gui/socketapi/socketapi.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* Copyright (C) by Dominik Schmidt <[email protected]>
* Copyright (C) by Klaas Freitag <[email protected]>
Expand Down Expand Up @@ -894,7 +894,7 @@
const auto account = fileData.folder->accountState()->account();
const auto getOrCreatePublicLinkShareJob = new GetOrCreatePublicLinkShare(account, fileData.serverRelativePath, true, this);
connect(getOrCreatePublicLinkShareJob, &GetOrCreatePublicLinkShare::done, this, [](const QString &url) { copyUrlToClipboard(url); });
connect(getOrCreatePublicLinkShareJob, &GetOrCreatePublicLinkShare::error, this, [=]() { emit shareCommandReceived(fileData.localPath); });
connect(getOrCreatePublicLinkShareJob, &GetOrCreatePublicLinkShare::error, this, [=, this]() { emit shareCommandReceived(fileData.localPath); });
getOrCreatePublicLinkShareJob->run();
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "notificationhandler.h"
#include "usermodel.h"
#include "common/filesystembase.h"
Expand Down Expand Up @@ -73,7 +73,7 @@
this, &User::slotCheckExpiredActivities);

connect(_account.data(), &AccountState::stateChanged,
[=]() { if (isConnected()) {slotRefreshImmediately();} });
[=, this]() { if (isConnected()) {slotRefreshImmediately();} });
connect(_account.data(), &AccountState::stateChanged, this, &User::accountStateChanged);
connect(_account.data(), &AccountState::hasFetchedNavigationApps,
this, &User::slotRebuildNavigationAppList);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/userinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void UserInfo::slotUpdateLastInfo(const QJsonDocument &json)
if (QString::compare(account->davUser(), newUserId, Qt::CaseInsensitive) != 0) {
// TODO: the error message should be in the UI
qInfo() << "Authenticated with the wrong user! Please login with the account:" << account->prettyName();
if (const auto cred = account->credentials()) {
if (account->credentials()) {
account->credentials()->askFromUser();
}
return;
Expand Down
8 changes: 4 additions & 4 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* Copyright (C) by Olivier Goffart <[email protected]>
*
Expand Down Expand Up @@ -675,7 +675,7 @@
_pendingAsyncJobs++;
_discoveryData->checkSelectiveSyncNewFolder(path._server,
serverEntry.remotePerm,
[=](bool result) {
[=, this](bool result) {
--_pendingAsyncJobs;
if (!result) {
processFileAnalyzeLocalInfo(item, path, localEntry, serverEntry, dbEntry, _queryServer);
Expand Down Expand Up @@ -732,7 +732,7 @@
item->_e2eEncryptionServerCapability = EncryptionStatusEnums::fromEndToEndEncryptionApiVersion(_discoveryData->_account->capabilities().clientSideEncryptionVersion());
item->_e2eCertificateFingerprint = serverEntry.e2eCertificateFingerprint;
}
item->_encryptedFileName = [=] {
item->_encryptedFileName = [=, this] {
if (serverEntry.e2eMangledName.isEmpty()) {
return QString();
}
Expand Down Expand Up @@ -1023,7 +1023,7 @@
// we need to make a request to the server to know that the original file is deleted on the server
_pendingAsyncJobs++;
const auto job = new RequestEtagJob(_discoveryData->_account, _discoveryData->_remoteFolder + originalPath, this);
connect(job, &RequestEtagJob::finishedWithResult, this, [=](const HttpResult<QByteArray> &etag) mutable {
connect(job, &RequestEtagJob::finishedWithResult, this, [=, this](const HttpResult<QByteArray> &etag) mutable {
_pendingAsyncJobs--;
QTimer::singleShot(0, _discoveryData, &DiscoveryPhase::scheduleMoreJobs);
if (etag || etag.error().code != 404 ||
Expand Down Expand Up @@ -1549,7 +1549,7 @@
if (base.isVirtualFile() && isVfsWithSuffix())
chopVirtualFileSuffix(serverOriginalPath);
auto job = new RequestEtagJob(_discoveryData->_account, serverOriginalPath, this);
connect(job, &RequestEtagJob::finishedWithResult, this, [=](const HttpResult<QByteArray> &etag) mutable {
connect(job, &RequestEtagJob::finishedWithResult, this, [=, this](const HttpResult<QByteArray> &etag) mutable {


if (!etag || (etag.get() != base._etag && !item->isDirectory()) || _discoveryData->isRenamed(originalPath)
Expand Down
4 changes: 2 additions & 2 deletions src/libsync/discoveryphase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void DiscoveryPhase::checkFolderSizeLimit(const QString &path, const std::functi
connect(propfindJob, &PropfindJob::finishedWithError, this, [=] {
return completionCallback(false);
});
connect(propfindJob, &PropfindJob::result, this, [=](const QVariantMap &values) {
connect(propfindJob, &PropfindJob::result, this, [=, this](const QVariantMap &values) {
const auto result = values.value(QLatin1String("size")).toLongLong();
const auto limit = _syncOptions._newBigFolderSizeLimit;
qCDebug(lcDiscovery) << "Folder size check complete for" << path << "result:" << result << "limit:" << limit;
Expand Down Expand Up @@ -773,7 +773,7 @@ void DiscoverySingleDirectoryJob::metadataReceived(const QJsonDocument &json, in
}
};

std::transform(std::cbegin(_results), std::cend(_results), std::begin(_results), [=](const RemoteInfo &info) {
std::transform(std::cbegin(_results), std::cend(_results), std::begin(_results), [=, this](const RemoteInfo &info) {
auto result = info;
const auto encryptedFileInfo = findEncryptedFile(result.name);
if (encryptedFileInfo) {
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/vfs/xattr/vfs_xattr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ bool VfsXAttr::statTypeVirtualFile(csync_file_stat_t *stat, void *statData)
Q_ASSERT(!stat->path.startsWith('/'));

const auto path = QByteArray(*parentPath + '/' + stat->path);
const auto pin = [=] {
const auto pin = [=, this] {
const auto absolutePath = QString::fromUtf8(path);
Q_ASSERT(absolutePath.startsWith(params().filesystemPath.toUtf8()));
const auto folderPath = absolutePath.mid(params().filesystemPath.length());
Expand Down
Loading