aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-04-11 15:57:06 -0300
committerQt by Nokia <qt-info@nokia.com>2012-04-12 05:02:33 +0200
commit2d393ae042d5badf0862c0f95122f9662042f2a9 (patch)
treed2317201139ec9c6410365e5f290e3d2501c5f17 /src
parenta896d4b39ec3d45ba708d9b36ea9c864b1df2136 (diff)
Stop stuffing the URL "<Unknown File>" in QML errors
QQmlError already knows how to deal with source scripts with no URL and it will use "<Unknown File>" when converting to a string. QUrl in Qt 5 leaves the "<" and ">" characters encoded, which means we ended up getting warnings about "%3CUnknown File%3E", which isn't nice. Change-Id: I504604fa37bb734549048432aaf9db3b1fa568d2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlbinding.cpp2
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp2
-rw-r--r--src/qml/qml/v8/qv8bindings.cpp5
3 files changed, 2 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index c4f48ef63d..d2a02dc712 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -230,8 +230,6 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags)
if (needsErrorData) {
QUrl url = QUrl(m_url);
- if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
-
delayedError()->error.setUrl(url);
delayedError()->error.setLine(m_lineNumber);
delayedError()->error.setColumn(m_columnNumber);
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index aad6a04714..569a292a8b 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -263,7 +263,7 @@ void QQmlJavaScriptExpression::exceptionToError(v8::Handle<v8::Message> message,
v8::Local<v8::String> file = name->IsString()?name->ToString():v8::Local<v8::String>();
if (file.IsEmpty() || file->Length() == 0)
- error.setUrl(QUrl(QLatin1String("<Unknown File>")));
+ error.setUrl(QUrl());
else
error.setUrl(QUrl(QV8Engine::toStringStatic(file)));
diff --git a/src/qml/qml/v8/qv8bindings.cpp b/src/qml/qml/v8/qv8bindings.cpp
index 025854f1ac..65c395e013 100644
--- a/src/qml/qml/v8/qv8bindings.cpp
+++ b/src/qml/qml/v8/qv8bindings.cpp
@@ -144,10 +144,7 @@ void QV8Bindings::Binding::update(QQmlPropertyPrivate::WriteFlags flags)
if (!watcher.wasDeleted() && !destroyedFlag()) {
if (needsErrorData) {
- QUrl url = parent->url();
- if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
-
- delayedError()->error.setUrl(url);
+ delayedError()->error.setUrl(parent->url());
delayedError()->error.setLine(instruction->line);
delayedError()->error.setColumn(-1);
}