1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

FCM: port foreach -> range-based for

Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
Juraj Oravec 2019-12-30 17:20:44 +01:00
parent 9bcfeb3cd7
commit 9330f8cc04
No known key found for this signature in database
GPG Key ID: 63ACB65056BC8D07
2 changed files with 10 additions and 8 deletions

View File

@ -97,7 +97,7 @@ void FCM_Dialog::removeAll()
}
const QList<FlashCookie> &flashCookies = m_manager->flashCookies();
foreach (const FlashCookie &flashCookie, flashCookies) {
for (const FlashCookie &flashCookie : flashCookies) {
m_manager->removeCookie(flashCookie);
}
@ -118,7 +118,7 @@ void FCM_Dialog::removeCookie()
if (data.isNull()) { //Remove whole cookie group
const QString origin = current->text(0);
const QList<FlashCookie> &flashCookies = m_manager->flashCookies();
foreach (const FlashCookie &flashCookie, flashCookies) {
for (const FlashCookie &flashCookie : flashCookies) {
if (flashCookie.origin == origin) {
m_manager->removeCookie(flashCookie);
}

View File

@ -86,7 +86,8 @@ void FCM_Plugin::init(InitState state, const QString &settingsPath)
}
if (state == LateInitState) {
foreach (BrowserWindow* window, mApp->windows()) {
const auto windows = mApp->windows();
for (BrowserWindow* window : windows) {
mainWindowCreated(window);
}
}
@ -102,7 +103,8 @@ void FCM_Plugin::unload()
removeAllButWhitelisted();
}
foreach (BrowserWindow* window, mApp->windows()) {
const auto windows = mApp->windows();
for (BrowserWindow* window : windows) {
mainWindowDeleted(window);
}
@ -169,7 +171,7 @@ bool FCM_Plugin::isWhitelisted(const FlashCookie &flashCookie)
void FCM_Plugin::removeAllButWhitelisted()
{
foreach (const FlashCookie &flashCookie, m_flashCookies) {
for (const FlashCookie &flashCookie : qAsConst(m_flashCookies)) {
if (isWhitelisted(flashCookie)) {
continue;
}
@ -255,7 +257,7 @@ void FCM_Plugin::autoRefresh()
loadFlashCookies();
QStringList newCookieList;
foreach (const FlashCookie &flashCookie, m_flashCookies) {
for (const FlashCookie &flashCookie : qAsConst(m_flashCookies)) {
if (isBlacklisted(flashCookie)) {
removeCookie(flashCookie);
continue;
@ -266,7 +268,7 @@ void FCM_Plugin::autoRefresh()
}
bool newCookie = true;
foreach (const FlashCookie &oldFlashCookie, oldflashCookies) {
for (const FlashCookie &oldFlashCookie : qAsConst(oldflashCookies)) {
if (QString(oldFlashCookie.path + oldFlashCookie.name) ==
QString(flashCookie.path + flashCookie.name)) {
newCookie = false;
@ -376,7 +378,7 @@ void FCM_Plugin::loadFlashCookies(QString path)
entryList.removeAll(QL1S("."));
entryList.removeAll(QL1S(".."));
foreach(QString entry, entryList) {
for (QString entry : qAsConst(entryList)) {
if (path.endsWith(QL1S("#SharedObjects")) && entry == QL1S("#AppContainer")) {
// specific to IE and Windows
continue;