summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adblock/adblockmanager.cpp2
-rw-r--r--src/bookmarks/bookmarkstreemodel.cpp4
-rw-r--r--src/history/historymodels.cpp4
-rw-r--r--src/mainwindow.cpp2
-rw-r--r--src/searchengine.cpp17
-rw-r--r--src/searchengine.h2
-rw-r--r--src/sessionmanager.cpp2
-rw-r--r--src/settings/adblockwidget.cpp2
-rw-r--r--src/urlbar/completionwidget.cpp2
-rw-r--r--src/urlbar/listitem.cpp3
-rw-r--r--src/urlbar/listitem.h8
-rw-r--r--src/urlbar/rsswidget.cpp8
-rw-r--r--src/urlbar/urlbar.cpp2
-rw-r--r--src/urlbar/urlresolver.cpp10
-rw-r--r--src/urlbar/urlresolver.h2
-rw-r--r--src/websnap.h2
16 files changed, 37 insertions, 35 deletions
diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp
index 55e3b5d7..70923d7d 100644
--- a/src/adblock/adblockmanager.cpp
+++ b/src/adblock/adblockmanager.cpp
@@ -117,7 +117,7 @@ void AdBlockManager::loadRules(const QStringList &rules)
if (stringRule.startsWith('!'))
continue;
- // [ rules are ABP infos
+ // [ rules are ABP info
if (stringRule.startsWith('['))
continue;
diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp
index 5fffa3da..654069c2 100644
--- a/src/bookmarks/bookmarkstreemodel.cpp
+++ b/src/bookmarks/bookmarkstreemodel.cpp
@@ -75,12 +75,12 @@ QVariant BtmItem::data(int role) const
}
if (m_kbm.isGroup())
{
- tooltip += " [" + QString::number(childCount()) + " " + i18n("Items") + "]";
+ tooltip += " [" + QString::number(childCount()) + ' ' + i18n("Items") + ']';
}
if (!m_kbm.url().url().isEmpty())
{
if (!tooltip.isEmpty())
- tooltip += "\n";
+ tooltip += '\n';
tooltip += m_kbm.url().url();
}
return tooltip;
diff --git a/src/history/historymodels.cpp b/src/history/historymodels.cpp
index 79235b1f..887a6f5c 100644
--- a/src/history/historymodels.cpp
+++ b/src/history/historymodels.cpp
@@ -149,8 +149,8 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const
case Qt::ToolTipRole:
QString tooltip = "";
if (!item.title.isEmpty())
- tooltip = item.title + "\n";
- tooltip += item.dateTime.toString(Qt::SystemLocaleShortDate) + "\n" + item.url;
+ tooltip = item.title + '\n';
+ tooltip += item.dateTime.toString(Qt::SystemLocaleShortDate) + '\n' + item.url;
return tooltip;
}
return QVariant();
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 037457bc..bcb1d496 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1246,4 +1246,4 @@ void MainWindow::populateEncodingMenu()
if (currentCodec == codec)
action->setChecked(true);
}
-} \ No newline at end of file
+}
diff --git a/src/searchengine.cpp b/src/searchengine.cpp
index 6541345b..d2bfaf34 100644
--- a/src/searchengine.cpp
+++ b/src/searchengine.cpp
@@ -78,7 +78,8 @@ KService::Ptr SearchEngine::fromString(QString text)
KService::Ptr service;
while (!found && i < providers.size())
{
- foreach(QString key, providers.at(i)->property("Keys").toStringList())
+ QStringList list = providers.at(i)->property("Keys").toStringList();
+ foreach(const QString &key, list)
{
const QString searchPrefix = key + delimiter();
if (text.startsWith(searchPrefix))
@@ -116,16 +117,17 @@ void SearchEngine::loadFavorites()
{
KConfig config("kuriikwsfilterrc"); //Share with konqueror
KConfigGroup cg = config.group("General");
- QStringList f;
- f << "wikipedia" << "google"; //defaults
- f = cg.readEntry("FavoriteSearchEngines", f);
+ QStringList favoriteEngines;
+ favoriteEngines << "wikipedia" << "google"; //defaults
+ favoriteEngines = cg.readEntry("FavoriteSearchEngines", favoriteEngines);
KService::List favorites;
KService::Ptr service;
- foreach(QString e, f)
+ foreach(const QString &engine, favoriteEngines)
{
- service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(e));
- if (service) favorites << service;
+ service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(engine));
+ if (service)
+ favorites << service;
}
m_favorites = favorites;
@@ -160,4 +162,3 @@ KService::Ptr SearchEngine::defaultEngine()
return KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(engine));
}
-
diff --git a/src/searchengine.h b/src/searchengine.h
index b31f420b..691833c1 100644
--- a/src/searchengine.h
+++ b/src/searchengine.h
@@ -62,4 +62,4 @@ private:
static KService::Ptr m_defaultWS;
};
-#endif \ No newline at end of file
+#endif
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index 80e78e64..3a2a8ae5 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -70,7 +70,7 @@ void SessionManager::saveSession()
}
QTextStream out(&sessionFile);
MainWindowList wl = Application::instance()->mainWindowList();
- Q_FOREACH(QWeakPointer<MainWindow> w, wl)
+ Q_FOREACH(const QWeakPointer<MainWindow> &w, wl)
{
out << "window\n";
MainView *mv = w.data()->mainView();
diff --git a/src/settings/adblockwidget.cpp b/src/settings/adblockwidget.cpp
index d4ae55af..59cb8a81 100644
--- a/src/settings/adblockwidget.cpp
+++ b/src/settings/adblockwidget.cpp
@@ -118,7 +118,7 @@ void AdBlockWidget::load()
QStringList subscriptions = ReKonfig::subscriptionTitles();
// load automatic rules
- foreach(QString sub, subscriptions)
+ foreach(const QString &sub, subscriptions)
{
QTreeWidgetItem *subItem = new QTreeWidgetItem(treeWidget);
subItem->setText(0, sub);
diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp
index 7c6c6fe7..230f96d4 100644
--- a/src/urlbar/completionwidget.cpp
+++ b/src/urlbar/completionwidget.cpp
@@ -68,7 +68,7 @@ void CompletionWidget::insertSearchList(const UrlSearchList &list, const QString
{
_list = list;
int i = 0;
- foreach(UrlSearchItem item, _list)
+ foreach(const UrlSearchItem &item, _list)
{
ListItem *suggestion = ListItemFactory::create(item, text, this);
suggestion->setBackgroundRole(i % 2 ? QPalette::AlternateBase : QPalette::Base);
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index ce1f8d9a..f8f93dcd 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -41,7 +41,6 @@
// KDE Includes
#include <KIcon>
#include <QActionGroup>
-#include <KIcon>
// Qt Includes
#include <QHBoxLayout>
@@ -195,7 +194,7 @@ TextLabel::TextLabel(const QString &text, const QString &textToPointOut, QWidget
{
QString t = text;
if (!textToPointOut.isEmpty())
- t = t.replace(QRegExp("(" + textToPointOut + ")", Qt::CaseInsensitive), "<b>\\1</b>");
+ t = t.replace(QRegExp('(' + textToPointOut + ')', Qt::CaseInsensitive), "<b>\\1</b>");
setText(t);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
diff --git a/src/urlbar/listitem.h b/src/urlbar/listitem.h
index 25d651d3..328e5af9 100644
--- a/src/urlbar/listitem.h
+++ b/src/urlbar/listitem.h
@@ -54,7 +54,7 @@ class ListItem : public QWidget
Q_OBJECT
public:
- ListItem(const UrlSearchItem &item, QWidget *parent = 0);
+ explicit ListItem(const UrlSearchItem &item, QWidget *parent = 0);
virtual ~ListItem();
void activate();
@@ -90,7 +90,7 @@ class TypeIconLabel : public QLabel
Q_OBJECT
public:
- TypeIconLabel(int type, QWidget *parent = 0);
+ explicit TypeIconLabel(int type, QWidget *parent = 0);
private:
QLabel *getIcon(QString icon);
@@ -129,7 +129,7 @@ class EngineBar : public KToolBar
Q_OBJECT
public:
- EngineBar(KService::Ptr selectedEngine, QWidget *parent = 0);
+ explicit EngineBar(KService::Ptr selectedEngine, QWidget *parent = 0);
void selectNextEngine();
signals:
@@ -152,7 +152,7 @@ class SearchListItem : public ListItem
Q_OBJECT
public:
- SearchListItem(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
+ explicit SearchListItem(const UrlSearchItem &item, const QString &text, QWidget *parent = 0);
public slots:
virtual void nextItemSubChoice();
diff --git a/src/urlbar/rsswidget.cpp b/src/urlbar/rsswidget.cpp
index e5ec50ee..9e26164e 100644
--- a/src/urlbar/rsswidget.cpp
+++ b/src/urlbar/rsswidget.cpp
@@ -61,7 +61,6 @@ RSSWidget::RSSWidget(QMap< KUrl, QString > map, QWidget *parent)
QFormLayout *layout = new QFormLayout(this);
setLayout(layout);
-
QLabel *agregator = new QLabel(this);
agregator->setText(i18n("Aggregator:"));
@@ -76,9 +75,12 @@ RSSWidget::RSSWidget(QMap< KUrl, QString > map, QWidget *parent)
feed->setText(i18n("Feed:"));
m_feeds = new KComboBox(this);
- foreach(QString title, m_map)
- m_feeds->addItem(title);
+ foreach(const QString &title, m_map)
+ {
+ m_feeds->addItem(title);
+ }
+
layout->addRow(feed, m_feeds);
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 4a992d25..ef0ee45c 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -347,7 +347,7 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic)
break;
case UrlBar::SSL:
rightIcon->setIcon(KIcon("object-locked"));
- rightIcon->setToolTip(i18n("Show SSL Infos"));
+ rightIcon->setToolTip(i18n("Show SSL Info"));
break;
default:
kDebug() << "ERROR.. default non extant case!!";
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index 4dd96041..2fd02c10 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -56,7 +56,7 @@
// 5. "fixhosturifilter"
-bool UrlSearchItem::operator==(UrlSearchItem i)
+bool UrlSearchItem::operator==(const UrlSearchItem &i)
{
return url == i.url;
}
@@ -118,12 +118,12 @@ UrlSearchList UrlResolver::orderedSearchItems()
}
}
- foreach(UrlSearchItem i, common)
+ foreach(const UrlSearchItem &i, common)
{
list << i;
}
- foreach(UrlSearchItem i, bookmarksList)
+ foreach(const UrlSearchItem &i, bookmarksList)
{
if (!common.contains(i))
list << i;
@@ -149,8 +149,8 @@ bool UrlResolver::isHttp()
"y[etu]|z[amw]|aero|arpa|biz|com|coop|edu|info|int|gov|mil|museum|name|net|org|"\
"pro)";
- return _typedString.startsWith("http://")
- || _typedString.startsWith("https://")
+ return _typedString.startsWith( QL1S("http://") )
+ || _typedString.startsWith( QL1S("https://") )
|| (QRegExp(address, Qt::CaseInsensitive).indexIn(_typedString) != -1)
|| (QRegExp(ipv4, Qt::CaseInsensitive).indexIn(_typedString) != -1)
|| (QRegExp(ipv6, Qt::CaseInsensitive).indexIn(_typedString) != -1);
diff --git a/src/urlbar/urlresolver.h b/src/urlbar/urlresolver.h
index c16fd09b..d3cdedbe 100644
--- a/src/urlbar/urlresolver.h
+++ b/src/urlbar/urlresolver.h
@@ -59,7 +59,7 @@ public:
: type(_type), url(_url), title(_title)
{};
- bool operator==(UrlSearchItem i);
+ bool operator==(const UrlSearchItem &i);
};
typedef QList <UrlSearchItem> UrlSearchList;
diff --git a/src/websnap.h b/src/websnap.h
index 45eaf62e..3c714c1b 100644
--- a/src/websnap.h
+++ b/src/websnap.h
@@ -73,7 +73,7 @@ public:
* @param url the url to load
* @param parent the object parent
*/
- WebSnap(const KUrl &url, QObject *parent = 0);
+ explicit WebSnap(const KUrl &url, QObject *parent = 0);
/**
* Snaps a pixmap of size w * h from a page and save it to cache