diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-10-14 17:00:35 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-10-14 17:00:35 +0200 |
commit | 8893e39a048a68864770403e4b99feda67464d70 (patch) | |
tree | ce09e8888caebaa88ede5724fff72777e97adf6b /src/mainwindow.cpp | |
parent | Fix crash on private mode store/restore (diff) | |
download | rekonq-8893e39a048a68864770403e4b99feda67464d70.tar.xz |
Sanitizing strings...
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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); |