aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcomponent.cpp
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-03-05 11:39:24 +1000
committerMatthew Vogt <matthew.vogt@nokia.com>2012-03-05 11:39:54 +1000
commit0284817d6cd7e17afa8da26ee6e9199100754446 (patch)
treec351d55d5a606c81c72e481f846b9b9e2603c883 /src/qml/qml/qqmlcomponent.cpp
parent377eb94eb19dafeca20d12bc6b624f1779fae514 (diff)
parent36bd7f616f37f5f60e59bce1f0d8970248d627de (diff)
Merge master <-> api_changes
Diffstat (limited to 'src/qml/qml/qqmlcomponent.cpp')
-rw-r--r--src/qml/qml/qqmlcomponent.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index e168f063c0..5dd8fc8ae9 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -51,6 +51,7 @@
#include "qqmlengine.h"
#include "qqmlbinding_p.h"
#include "qqmlbinding_p_p.h"
+#include "qqmlglobal_p.h"
#include "qqmlscript_p.h"
#include <private/qqmlprofilerservice_p.h>
#include <private/qqmlenginedebugservice_p.h>
@@ -738,14 +739,15 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context)
QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(engine);
- bool isRoot = enginePriv->inProgressCreations == 0;
+ if (enginePriv->inProgressCreations == 0) {
+ // only track root, since further ones might not be properly nested
+ profiler = new QQmlObjectCreatingProfiler();
+ }
+
enginePriv->inProgressCreations++;
state.errors.clear();
state.completePending = true;
- if (isRoot)
- QQmlProfilerService::startRange(QQmlProfilerService::Creating);
-
enginePriv->referenceScarceResources();
state.vme.init(context, cc, start, creationContext);
QObject *rv = state.vme.execute(&state.errors);
@@ -761,13 +763,12 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context)
if (!context->isInternal)
context->asQQmlContextPrivate()->instances.append(rv);
QQmlEngineDebugService::instance()->objectCreated(engine, rv);
- if (isRoot) {
- QQmlProfilerService::rangeData(QQmlProfilerService::Creating,
- buildTypeNameForDebug(rv->metaObject()));
+
+ if (profiler && profiler->enabled) {
+ profiler->setTypeName(buildTypeNameForDebug(rv->metaObject()));
QQmlData *data = QQmlData::get(rv);
Q_ASSERT(data);
- QQmlProfilerService::rangeLocation(QQmlProfilerService::Creating,
- cc->url, data->lineNumber, data->columnNumber);
+ profiler->setLocation(cc->url, data->lineNumber, data->columnNumber);
}
}
@@ -823,7 +824,8 @@ void QQmlComponentPrivate::completeCreate()
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine);
complete(ep, &state);
- QQmlProfilerService::endRange(QQmlProfilerService::Creating);
+ delete profiler;
+ profiler = 0;
}
}