From 1457cfc1fd8b603a9b1661b258659d4a97ab29f4 Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Mon, 30 Dec 2019 17:50:55 +0100 Subject: [PATCH] CookieManager: port foreach -> range-based for Signed-off-by: Juraj Oravec --- src/lib/cookies/cookiemanager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/cookies/cookiemanager.cpp b/src/lib/cookies/cookiemanager.cpp index a6017727d..b6866f0a9 100644 --- a/src/lib/cookies/cookiemanager.cpp +++ b/src/lib/cookies/cookiemanager.cpp @@ -96,8 +96,10 @@ CookieManager::CookieManager(QWidget *parent) connect(mApp->cookieJar(), &CookieJar::cookieRemoved, this, &CookieManager::removeCookie); // Load cookies - foreach (const QNetworkCookie &cookie, mApp->cookieJar()->getAllCookies()) + const auto allCookies = mApp->cookieJar()->getAllCookies(); + for (const QNetworkCookie &cookie : allCookies) { addCookie(cookie); + } QzTools::setWmClass("Cookies", this); } @@ -137,7 +139,7 @@ void CookieManager::remove() } } - foreach (const QNetworkCookie &cookie, cookies) { + for (const QNetworkCookie &cookie : qAsConst(cookies)) { mApp->cookieJar()->deleteCookie(cookie); } }