From c376a1988f8bd026b46a45a640abc810dc7f6fda Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 22 Sep 2009 12:24:54 +0200 Subject: Fixing foreach macros.. --- src/cookiejar.cpp | 2 +- src/homepage.cpp | 2 +- src/networkaccessmanager.cpp | 2 +- src/sessionmanager.cpp | 2 +- src/tabbar.cpp | 13 ++++++------- src/webpage.cpp | 2 +- src/webview.cpp | 2 +- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/cookiejar.cpp b/src/cookiejar.cpp index cd7b97fa..a8ba18bc 100644 --- a/src/cookiejar.cpp +++ b/src/cookiejar.cpp @@ -84,7 +84,7 @@ QList CookieJar::cookiesForUrl(const QUrl & url) const bool CookieJar::setCookiesFromUrl(const QList & cookieList, const QUrl & url) { QByteArray cookieHeader; - foreach(const QNetworkCookie& cookie, cookieList) + Q_FOREACH(const QNetworkCookie& cookie, cookieList) { cookieHeader = "Set-Cookie: "; cookieHeader += cookie.toRawForm(); diff --git a/src/homepage.cpp b/src/homepage.cpp index aa679999..8dccc3fd 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -127,7 +127,7 @@ QString HomePage::recentlyClosedTabs() KUrl::List links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs(); - foreach(const KUrl &url, links) + Q_FOREACH(const KUrl &url, links) { closed += "
  • " + url.prettyUrl() + "
  • "; } diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index b2958d9e..6a89d104 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -117,7 +117,7 @@ void NetworkAccessManager::resetDiskCache() QDir cacheDir(location + QString("/http") ); QStringList fileList = cacheDir.entryList(); - foreach(QString str, fileList) + Q_FOREACH(QString str, fileList) { QFile file(str); file.remove(); diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp index c93a229d..0c2c5c32 100644 --- a/src/sessionmanager.cpp +++ b/src/sessionmanager.cpp @@ -66,7 +66,7 @@ void SessionManager::saveSession() } QDataStream out(&sessionFile); MainWindowList wl = Application::instance()->mainWindowList(); - foreach(QPointer w, wl) + Q_FOREACH(QPointer w, wl) { out << QByteArray("window"); MainView *mv = w->mainView(); diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 3f3faabc..dfc1482c 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -75,14 +75,13 @@ void TabBar::postLaunch() { // Find the correct MainWindow of this tab button MainWindowList list = Application::instance()->mainWindowList(); - MainWindow *window; - foreach (window, list) + Q_FOREACH(QPointer w, list) { - if (window->isAncestorOf(this)) - { - m_addTabButton->setDefaultAction(window->actionByName("new_tab")); - break; - } + if (w->isAncestorOf(this)) + { + m_addTabButton->setDefaultAction(w->actionByName("new_tab")); + break; + } } m_addTabButton->setAutoRaise(true); diff --git a/src/webpage.cpp b/src/webpage.cpp index 697cf448..d5d1cd7c 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -200,7 +200,7 @@ void WebPage::manageNetworkErrors(QNetworkReply* reply) return; } QList children = firstFrame->childFrames(); - foreach(QWebFrame *frame, children) + Q_FOREACH(QWebFrame *frame, children) { frames.append(frame); } diff --git a/src/webview.cpp b/src/webview.cpp index 8a74e76b..21a24c4f 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -175,7 +175,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) KService::Ptr service; KUriFilterData data; - foreach (const QString &engine, favoriteEngines) + Q_FOREACH(const QString &engine, favoriteEngines) { if(!engine.isEmpty()) { -- cgit v1.2.1