summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-05-04 11:21:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-05 13:40:00 +0200
commit143daa6ac29940f0136034c99cddc932a4ec0a42 (patch)
tree95bfa75091d49847ff83bbf0d86a96156b69cf41 /src
parentfb631d10d0f102c63a574c48d28124d5afcf0343 (diff)
Correctly locate files with relative paths
QUrl("relativefilename").toLocalFile() changed behavior and now returns an empty string if the scheme is not set. Setting the scheme to "file:" in setSource would however break some other assumptions in the code about relative url's. Task-number: QTBUG-22416 Change-Id: I1b3fcbef81f6e356935ec426903989e783ce9a78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qtextbrowser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp
index b8ffced6bb..c6b1a6db16 100644
--- a/src/widgets/widgets/qtextbrowser.cpp
+++ b/src/widgets/widgets/qtextbrowser.cpp
@@ -153,6 +153,8 @@ QString QTextBrowserPrivate::findFile(const QUrl &name) const
QString fileName;
if (name.scheme() == QLatin1String("qrc"))
fileName = QLatin1String(":/") + name.path();
+ else if (name.scheme().isEmpty())
+ fileName = name.path();
else
fileName = name.toLocalFile();