From 498eac8ccbc952228ab14178fc36635360ddde91 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Thu, 27 May 2010 10:57:10 -0400 Subject: Const iterator fixes --- src/mainwindow.cpp | 2 +- src/newtabpage.cpp | 3 +-- src/webpage.cpp | 4 ++-- src/webtab.cpp | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 95fbd92d..d5b81c1e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -680,7 +680,7 @@ void MainWindow::updateActions() if (am->menu()) am->menu()->clear(); - foreach (HistoryItem item, mainView()->recentlyClosedTabs()) + foreach (const HistoryItem &item, mainView()->recentlyClosedTabs()) { KAction *a = new KAction(Application::icon(item.url), item.title, this); a->setData(item.url); diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 2ab52c50..9c381f97 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -380,8 +380,7 @@ void NewTabPage::browsingMenu(const KUrl ¤tUrl) nav.findFirst("span").appendInside(i18n("Downloads")); navItems.append(nav); - QWebElement it; - foreach(it, navItems) + foreach(QWebElement it, navItems) { if (it.findFirst("a").attribute("href") == currentUrl.toMimeDataString()) it.addClass("current"); diff --git a/src/webpage.cpp b/src/webpage.cpp index 00745445..45059def 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -615,14 +615,14 @@ void WebPage::downloadAllContentsWithKGet(QPoint) KUrl relativeUrl; QWebElementCollection images = mainFrame()->documentElement().findAll("img"); - foreach(QWebElement img, images) + foreach(const QWebElement &img, images) { relativeUrl.setEncodedUrl(img.attribute("src").toUtf8(), KUrl::TolerantMode); contents << baseUrl.resolved(relativeUrl).toString(); } QWebElementCollection links = mainFrame()->documentElement().findAll("a"); - foreach(QWebElement link, links) + foreach(const QWebElement &link, links) { relativeUrl.setEncodedUrl(link.attribute("href").toUtf8(), KUrl::TolerantMode); contents << baseUrl.resolved(relativeUrl).toString(); diff --git a/src/webtab.cpp b/src/webtab.cpp index a6bedc97..47780a44 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -183,7 +183,7 @@ void WebTab::showRSSInfo(QPoint pos) QMap map; - foreach(QWebElement el, col) + foreach(const QWebElement &el, col) { QString urlString; if (el.attribute("href").startsWith(QL1S("http"))) -- cgit v1.2.1