From d622999971a4bbd9ce703ef45725b893ec5a154a Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 17 May 2022 10:07:37 +0200 Subject: [PATCH] add explicit capture for lambda Signed-off-by: Matthieu Gallien --- src/gui/tray/notificationhandler.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/tray/notificationhandler.cpp b/src/gui/tray/notificationhandler.cpp index b429093ad7fd7..9a9e1893b9e45 100644 --- a/src/gui/tray/notificationhandler.cpp +++ b/src/gui/tray/notificationhandler.cpp @@ -150,9 +150,11 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j // Add another action to dismiss notification on server // https://github.com/owncloud/notifications/blob/master/docs/ocs-endpoint-v1.md#deleting-a-notification-for-a-user constexpr auto deleteVerb = "DELETE"; - if (std::find_if(std::cbegin(a._links), std::cend(a._links), [](const ActivityLink& link) { - return link._verb == deleteVerb; - }) == std::cend(a._links)) { + const auto itLink = std::find_if(std::cbegin(a._links), std::cend(a._links), [deleteVerb](const ActivityLink& link) { + Q_UNUSED(deleteVerb) + return link._verb == deleteVerb; + }); + if (itLink == std::cend(a._links)) { ActivityLink al; al._label = tr("Dismiss"); al._link = Utility::concatUrlPath(ai->account()->url(), notificationsPath + "/" + QString::number(a._id)).toString();