summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2011-09-01 13:11:33 (GMT)
committermread <qt-info@nokia.com>2011-09-01 13:18:40 (GMT)
commitadfa2dde84ff7ed1a8b177c2a7e885e752e9bb0b (patch)
tree3808c57ad8e8314bec4a7decf0ca14fca85f194c /src
parent6291d642b164bdf0ce55419e41809b526ad4cd03 (diff)
downloadQt-adfa2dde84ff7ed1a8b177c2a7e885e752e9bb0b.zip
Qt-adfa2dde84ff7ed1a8b177c2a7e885e752e9bb0b.tar.gz
Qt-adfa2dde84ff7ed1a8b177c2a7e885e752e9bb0b.tar.bz2
URLs used with scheme handler use appropriate encoding for scheme
URLs passed to scheme handler always used to use raw encoding. That broke URLs containing spaces passed to the browser. Then QTBUG-18772 changed it so that they always used % encoding. That broke URLs containing spaces used to open files, resulting in QTBUG-21209. This change fixes it so that web URLs are % encoded and file URLs are raw encoded. Task-number: QTBUG-21209 Reviewed-by: Honglei Zhang
Diffstat (limited to 'src')
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index 97d1226..ae203cd 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -309,12 +309,12 @@ static void handleUrlL(const TDesC& aUrl)
CleanupStack::PopAndDestroy();
}
-static bool handleUrl(const QUrl &url)
+static bool handleUrl(const QUrl &url, bool useEncodedUrl)
{
if (!url.isValid())
return false;
- QString urlString(url.toEncoded());
+ QString urlString(useEncodedUrl ? url.toEncoded() : url.toString());
TPtrC urlPtr(qt_QString2TPtrC(urlString));
TRAPD( err, handleUrlL(urlPtr));
return err ? false : true;
@@ -322,12 +322,12 @@ static bool handleUrl(const QUrl &url)
static bool launchWebBrowser(const QUrl &url)
{
- return handleUrl(url);
+ return handleUrl(url, true);
}
static bool openDocument(const QUrl &file)
{
- return handleUrl(file);
+ return handleUrl(file, false);
}
#endif //USE_SCHEMEHANDLER