Don't use implicit lambda captures

This commit is contained in:
Tobias Fella
2023-05-17 23:49:56 +02:00
parent e42c1c1f69
commit 805332c599
3 changed files with 6 additions and 6 deletions

View File

@@ -113,10 +113,10 @@ Controller::Controller(QObject *parent)
#ifdef QUOTIENT_07
static int oldAccountCount = 0;
connect(&AccountRegistry::instance(), &AccountRegistry::accountCountChanged, this, [=]() {
connect(&AccountRegistry::instance(), &AccountRegistry::accountCountChanged, this, [this]() {
if (AccountRegistry::instance().size() > oldAccountCount) {
auto connection = AccountRegistry::instance().accounts()[AccountRegistry::instance().size() - 1];
connect(connection, &Connection::syncDone, this, [=]() {
connect(connection, &Connection::syncDone, this, [this]() {
handleNotifications(connection);
});
}
@@ -552,7 +552,7 @@ void Controller::setActiveConnection(Connection *connection)
m_isOnline = true;
Q_EMIT isOnlineChanged(true);
});
connect(connection, &Connection::requestFailed, this, [=](BaseJob *job) {
connect(connection, &Connection::requestFailed, this, [](BaseJob *job) {
if (dynamic_cast<DownloadFileJob *>(job) && job->jsonData()["errcode"].toString() == "M_TOO_LARGE"_ls) {
RoomManager::instance().warning(i18n("File too large to download."), i18n("Contact your matrix server administrator for support."));
}

View File

@@ -281,7 +281,7 @@ void RoomListModel::updateRoom(Room *room, Room *prev)
}
// Ok, we're through with pre-checks, now for the real thing.
auto newRoom = static_cast<NeoChatRoom *>(room);
const auto it = std::find_if(m_rooms.begin(), m_rooms.end(), [=](const NeoChatRoom *r) {
const auto it = std::find_if(m_rooms.begin(), m_rooms.end(), [prev, newRoom](const NeoChatRoom *r) {
return r == prev || r == newRoom;
});
if (it != m_rooms.end()) {

View File

@@ -78,7 +78,7 @@ void NotificationsManager::postNotification(NeoChatRoom *room,
notification->setPixmap(QPixmap::fromImage(icon));
notification->setDefaultAction(i18n("Open NeoChat in this room"));
connect(notification, &KNotification::defaultActivated, this, [=]() {
connect(notification, &KNotification::defaultActivated, this, [notification, room]() {
WindowController::instance().showAndRaiseWindow(notification->xdgActivationToken());
if (!room) {
return;
@@ -118,7 +118,7 @@ void NotificationsManager::postInviteNotification(NeoChatRoom *room, const QStri
notification->setPixmap(img);
notification->setFlags(KNotification::Persistent);
notification->setDefaultAction(i18n("Open this invitation in NeoChat"));
connect(notification, &KNotification::defaultActivated, this, [=]() {
connect(notification, &KNotification::defaultActivated, this, [notification, room]() {
WindowController::instance().showAndRaiseWindow(notification->xdgActivationToken());
notification->close();
RoomManager::instance().enterRoom(room);