diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 3 | ||||
-rw-r--r-- | src/mainview.cpp | 2 | ||||
-rw-r--r-- | src/mainwindow.cpp | 7 | ||||
-rw-r--r-- | src/newtabpage.cpp | 2 | ||||
-rw-r--r-- | src/opensearch/suggestionparser.h | 12 | ||||
-rw-r--r-- | src/protocolhandler.cpp | 5 | ||||
-rw-r--r-- | src/sslinfo.ui | 6 | ||||
-rw-r--r-- | src/urlbar/sslwidget.cpp | 14 | ||||
-rw-r--r-- | src/urlbar/urlbar.cpp | 16 | ||||
-rw-r--r-- | src/useragent/useragentinfo.cpp | 4 |
10 files changed, 40 insertions, 31 deletions
diff --git a/src/application.cpp b/src/application.cpp index 6f9df43a..d770b3d1 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> @@ -733,7 +732,7 @@ void Application::queryQuit() { int answer = KMessageBox::questionYesNoCancel( mainWindow(), - i18n("Wanna close the window or the whole app?"), + i18n("Do you want to close the window or the whole application?"), i18n("Application/Window closing..."), KGuiItem(i18n("C&lose Current Window"), KIcon("window-close")), 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/mainwindow.cpp b/src/mainwindow.cpp index abd5455a..23ccf25d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -99,6 +99,7 @@ #include <QtWebKit/QWebHistory> #include <QSignalMapper> +#include <QTextDocument> MainWindow::MainWindow() @@ -1196,6 +1197,8 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) break; } + QString msgToShow = Qt::escape(msg); + // useful values WebTab *tab = m_view->currentWebTab(); @@ -1208,13 +1211,13 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) // Set Popup size QFontMetrics fm = m_popup->fontMetrics(); - QSize labelSize(fm.width(msg) + 2 * margin, fm.height() + 2 * margin); + QSize labelSize(fm.width(msgToShow) + 2 * margin, fm.height() + 2 * margin); if (labelSize.width() > halfWidth) labelSize.setWidth(halfWidth); m_popup->setFixedSize(labelSize); - m_popup->setText(fm.elidedText(msg, Qt::ElideMiddle, labelSize.width() - 2 * margin)); + m_popup->setText(fm.elidedText(msgToShow, Qt::ElideMiddle, labelSize.width() - 2 * margin)); const bool horizontalScrollbarIsVisible = tab->page()->currentFrame()->scrollBarMaximum(Qt::Horizontal); const bool verticalScrollbarIsVisible = tab->page()->currentFrame()->scrollBarMaximum(Qt::Vertical); 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/protocolhandler.cpp b/src/protocolhandler.cpp index 2af4214f..9bd029f2 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -55,6 +55,7 @@ // Qt Includes #include <QtNetwork/QNetworkRequest> #include <QtWebKit/QWebFrame> +#include <QTextDocument> static bool fileItemListLessThan(const KFileItem &s1, const KFileItem &s2) @@ -298,14 +299,14 @@ QString ProtocolHandler::dirHandling(const KFileItemList &list) Q_FOREACH(const KFileItem & item, orderedList) { msg += "<tr>"; - QString fullPath = item.url().prettyUrl(); + QString fullPath = Qt::escape(item.url().prettyUrl()); QString iconName = item.iconName(); QString icon = QString("file://") + KIconLoader::global()->iconPath(iconName, KIconLoader::Small); msg += "<td width=\"70%\">"; msg += "<img src=\"" + icon + "\" alt=\"" + iconName + "\" /> "; - msg += "<a href=\"" + fullPath + "\">" + item.name() + "</a>"; + msg += "<a href=\"" + fullPath + "\">" + Qt::escape(item.name()) + "</a>"; msg += "</td>"; msg += "<td align=\"right\">"; diff --git a/src/sslinfo.ui b/src/sslinfo.ui index 41393bb4..3ed117a8 100644 --- a/src/sslinfo.ui +++ b/src/sslinfo.ui @@ -298,11 +298,7 @@ <item> <widget class="QLabel" name="label_23"> <property name="text"> - <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:medium; font-weight:600;">Digests:</span></p></body></html></string> + <string><h4>Digests:</h4></string> </property> </widget> </item> diff --git a/src/urlbar/sslwidget.cpp b/src/urlbar/sslwidget.cpp index 525df7a1..708c1259 100644 --- a/src/urlbar/sslwidget.cpp +++ b/src/urlbar/sslwidget.cpp @@ -81,7 +81,7 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) label->setWordWrap(true); if (cert.isNull()) { - label->setText(i18n("Warning: this site is NOT carrying a certificate!")); + label->setText(i18n("Warning: this site is NOT carrying a certificate.")); imageLabel->setPixmap(KIcon("security-low").pixmap(32)); layout->addWidget(label, rows++, 1); } @@ -103,7 +103,7 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) } c += QL1S("</ul>"); - label->setText(i18n("The certificate for this site is NOT valid, for the following reasons:\n%1", c)); + label->setText(i18n("The certificate for this site is NOT valid, for the following reasons:\n%1.", c)); label->setTextFormat(Qt::RichText); imageLabel->setPixmap(KIcon("security-low").pixmap(32)); } @@ -112,7 +112,7 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) label = new QLabel(this); label->setWordWrap(true); - label->setText("<a href=\"moresslinfos\">Certificate Information</a>"); + label->setText(QL1S("\"<a href=\"moresslinfos\">") + i18n("Certificate Information") + QL1S("</a>")); connect(label, SIGNAL(linkActivated(const QString &)), this, SLOT(showMoreSslInfos(const QString &))); layout->addWidget(label, rows++, 1); } @@ -134,7 +134,7 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) { label = new QLabel(this); label->setWordWrap(true); - label->setText(i18n("Your connection to %1 is NOT encrypted!!\n", m_url.host())); + label->setText(i18n("Your connection to %1 is NOT encrypted.\n", m_url.host())); layout->addWidget(label, rows++ , 1); imageLabel->setPixmap(KIcon("security-low").pixmap(32)); @@ -143,7 +143,7 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) { label = new QLabel(this); label->setWordWrap(true); - label->setText(i18n("Your connection to \"%1\" is encrypted!\n", m_url.host())); + label->setText(i18n("Your connection to \"%1\" is encrypted.\n", m_url.host())); layout->addWidget(label, rows++, 1); QString vers = m_info.protocol(); @@ -211,12 +211,12 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) if (firstVisit.visitCount == 1) { - label->setText(i18n("It is your first time visiting this site!")); + label->setText(i18n("It is your first time visiting this site.")); imageLabel->setPixmap(KIcon("security-medium").pixmap(32)); } else { - label->setText(i18n("You just visited this site!\nYour first visit was on %1.\n", firstVisit.firstDateTimeVisit.toString())); + label->setText(i18n("You just visited this site.\nYour first visit was on %1.\n", firstVisit.firstDateTimeVisit.toString())); imageLabel->setPixmap(KIcon("security-high").pixmap(32)); } layout->addWidget(label, rows++, 1); 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; } |