summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Yacovlev <V.Yacovlev@gmail.com>2013-04-30 17:12:22 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-04-30 17:12:22 +0200
commite0e45d94b3c1221257ff816e51869f531ad8a9fd (patch)
tree2cf28556f3f1d0dc216bd71235670111776a80e0
parentDOC subdir is automatically added from releaseme (diff)
downloadrekonq-e0e45d94b3c1221257ff816e51869f531ad8a9fd.tar.xz
Fix UNICODE sysmbols shown in the urlbar
BUG: 317697 REVIEWED-BY: adjam
-rw-r--r--src/urlbar/urlbar.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 19816d35..a14e39b5 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -180,7 +180,16 @@ void UrlBar::setQUrl(const QUrl& url)
return;
clearFocus();
- KLineEdit::setUrl(url);
+
+ // Workaround for KLineEdit bug: incorrectly displaying
+ // unicode symbols at query parameter
+ const QByteArray urlTextData = url.toString().toUtf8();
+ const QString humanReadableUrl = QString::fromUtf8(
+ QByteArray::fromPercentEncoding(urlTextData).constData()
+ );
+ // End workaround
+ setText(humanReadableUrl);
+
setCursorPosition(0);
}
@@ -188,7 +197,16 @@ void UrlBar::setQUrl(const QUrl& url)
void UrlBar::loadRequestedUrl(const KUrl& url, Rekonq::OpenType type)
{
clearFocus();
- setUrl(url);
+
+ // Workaround for KLineEdit bug: incorrectly displaying
+ // unicode symbols at query parameter
+ const QByteArray urlTextData = url.prettyUrl().toUtf8();
+ const QString humanReadableUrl = QString::fromUtf8(
+ QByteArray::fromPercentEncoding(urlTextData).constData()
+ );
+ // End workaround
+ setText(humanReadableUrl);
+
rApp->loadUrl(url, type);
}