aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-10 15:17:36 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-16 17:14:20 +0000
commit61f218b4e772c1d97e32ef8031de0043473ebbef (patch)
tree3e3cb0fb11c338bef3595de027a31eb95a73f545 /src/qml/qml/v8/qqmlbuiltinfunctions.cpp
parent496ddbfd1fe27bdddf5c15cd0ea70df452a3ec04 (diff)
Speed up object creation
Avoid copying url and file name twice into the context every time we instantiate an object. Change-Id: I1c76b80b9c44f95512af5899d760151f6dcd7bb5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qqmlbuiltinfunctions.cpp')
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index 0522e4c0ed..58542e4479 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -1722,7 +1722,7 @@ ReturnedValue GlobalExtensions::method_qsTr(CallContext *ctx)
QV8Engine *v8engine = ctx->d()->engine->v8Engine;
QString context;
if (QQmlContextData *ctxt = v8engine->callingContext()) {
- QString path = ctxt->url.toString();
+ QString path = ctxt->urlString();
int lastSlash = path.lastIndexOf(QLatin1Char('/'));
int lastDot = path.lastIndexOf(QLatin1Char('.'));
int length = lastDot - (lastSlash + 1);