diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,9 @@ set(QT_MIN_VERSION "5.14.0") set(KF5_MIN_VERSION "5.66.0") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED On) + ################# set KDE specific information ################# find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) diff --git a/kded/notification.cpp b/kded/notification.cpp --- a/kded/notification.cpp +++ b/kded/notification.cpp @@ -35,6 +35,8 @@ #include #include +#include + Notification::Notification(QObject *parent) : QObject(parent) { @@ -569,13 +571,13 @@ m_activeConnectionsBeforeSleep.clear(); - const auto &connections = NetworkManager::activeConnections(); - for (const auto &connection : connections) { - if (connection->state() == NetworkManager::ActiveConnection::State::Activated || - connection->state() == NetworkManager::ActiveConnection::State::Activating) { - // we have an active or activating connection, don't tell the user we're no longer connected - return; - } + const auto ac = NetworkManager::activeConnections(); + if (std::any_of(ac.constBegin(), ac.constEnd(), [](const auto &connection) { + return connection->state() == NetworkManager::ActiveConnection::State::Activated + || connection->state() == NetworkManager::ActiveConnection::State::Activating; + })) { + // we have an active or activating connection, don't tell the user we're no longer connected + return; } KNotification *notify = new KNotification(QStringLiteral("NoLongerConnected"), KNotification::CloseOnTimeout);