summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/application.cpp1
-rw-r--r--src/mainview.cpp2
-rw-r--r--src/newtabpage.cpp2
-rw-r--r--src/opensearch/suggestionparser.h12
-rw-r--r--src/urlbar/urlbar.cpp16
-rw-r--r--src/useragent/useragentinfo.cpp4
6 files changed, 23 insertions, 14 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 6f9df43a..e1802099 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -61,7 +61,6 @@
#include <KWindowInfo>
#include <KGlobal>
#include <KCharsets>
-#include <KMessageBox>
// Qt Includes
#include <QVBoxLayout>
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 0cd61ddd..2b5a8202 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -644,7 +644,7 @@ void MainView::openClosedTab()
{
WebView *view = rApp->mainWindow()->mainView()->newWebTab()->view();
TabHistory history;
- Q_FOREACH(TabHistory item, m_recentlyClosedTabs)
+ Q_FOREACH(const TabHistory & item, m_recentlyClosedTabs)
{
if (item.history == action->data().toByteArray())
{
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index ba0c37ce..f797e497 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -632,4 +632,4 @@ void NewTabPage::updateWindowIcon()
{
int currentIndex = rApp->mainWindow()->mainView()->currentIndex();
rApp->mainWindow()->changeWindowIcon(currentIndex);
-} \ No newline at end of file
+}
diff --git a/src/opensearch/suggestionparser.h b/src/opensearch/suggestionparser.h
index 523a4e6f..c8a61b99 100644
--- a/src/opensearch/suggestionparser.h
+++ b/src/opensearch/suggestionparser.h
@@ -67,12 +67,12 @@ public:
{};
- Response(const QString &_title = QString(),
- const QString &_description = QString(),
- const QString &_url = QString(),
- const QString &_image = QString(),
- const int &_image_width = 0,
- const int &_image_height = 0) : title(_title),
+ explicit Response(const QString &_title = QString(),
+ const QString &_description = QString(),
+ const QString &_url = QString(),
+ const QString &_image = QString(),
+ const int &_image_width = 0,
+ const int &_image_height = 0) : title(_title),
description(_description),
url(_url),
image(_image),
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 0515f58b..7b77f3db 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -294,7 +294,7 @@ void UrlBar::keyPressEvent(QKeyEvent *event)
{
clearFocus();
if (text() != rApp->mainWindow()->currentTab()->view()->url().toString()
- && !rApp->mainWindow()->currentTab()->view()->url().toString().startsWith("about"))
+ && !rApp->mainWindow()->currentTab()->view()->url().toString().startsWith(QL1S("about")))
setText(rApp->mainWindow()->currentTab()->view()->url().toString());
event->accept();
}
@@ -518,10 +518,20 @@ void UrlBar::contextMenuEvent(QContextMenuEvent* event)
bool UrlBar::isValidURL(QString url)
{
bool isValid = false;
- if (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("ftp://"))
+ if (url.startsWith(QL1S("http://"))
+ || url.startsWith(QL1S("https://"))
+ || url.startsWith(QL1S("ftp://"))
+ )
url = url.remove(QRegExp("(http|https|ftp)://"));
- if (url.contains('.') && url.indexOf('.') > 0 && url.indexOf('.') < url.length() && !url.trimmed().contains(" ") && QUrl::fromUserInput(url).isValid())
+
+ if (url.contains(QL1C('.'))
+ && url.indexOf(QL1C('.')) > 0
+ && url.indexOf(QL1C('.')) < url.length()
+ && !url.trimmed().contains(QL1C(' '))
+ && QUrl::fromUserInput(url).isValid()
+ )
isValid = true;
+
return isValid;
}
diff --git a/src/useragent/useragentinfo.cpp b/src/useragent/useragentinfo.cpp
index d7defd59..0829a7e1 100644
--- a/src/useragent/useragentinfo.cpp
+++ b/src/useragent/useragentinfo.cpp
@@ -137,10 +137,10 @@ QString UserAgentInfo::userAgentDescription(int i)
if (!systemName.isEmpty() && !systemRelease.isEmpty())
{
// FIXME: needs a proper translation after stable release
- systemSummary = " " % QL1S("on") % " " % systemName % " " % systemRelease;
+ systemSummary = QL1C(' ') % QL1S("on") % QL1C(' ') % systemName % QL1C(' ') % systemRelease;
}
- return userAgentName(i) % " " % userAgentVersion(i) % systemSummary;
+ return userAgentName(i) % QL1C(' ') % userAgentVersion(i) % systemSummary;
}