diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-15 05:58:35 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-17 00:20:49 (GMT) |
commit | 26cd94ef47ffc969dc835e98b58eded14e669964 (patch) | |
tree | 9ec8e418ec0ce385bd07289d5368e221a5ce017e /src/declarative/qml/qdeclarativeproperty.cpp | |
parent | 06766918436dc6c5de2e605e7ed3421c548c6782 (diff) | |
download | Qt-26cd94ef47ffc969dc835e98b58eded14e669964.zip Qt-26cd94ef47ffc969dc835e98b58eded14e669964.tar.gz Qt-26cd94ef47ffc969dc835e98b58eded14e669964.tar.bz2 |
Optimization: Reduce unnecessary QObject allocations
Diffstat (limited to 'src/declarative/qml/qdeclarativeproperty.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeproperty.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index c55c22f..caa1acf 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -124,7 +124,7 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ct : d(new QDeclarativePropertyPrivate) { d->q = this; - d->context = ctxt; + d->context = ctxt?QDeclarativeContextData::get(ctxt):0; d->engine = ctxt?ctxt->engine():0; d->initDefault(obj); } @@ -177,7 +177,7 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QD : d(new QDeclarativePropertyPrivate) { d->q = this; - d->context = ctxt; + d->context = ctxt?QDeclarativeContextData::get(ctxt):0; d->engine = ctxt?ctxt->engine():0; d->initProperty(obj, name); if (!isValid()) { d->object = 0; d->context = 0; d->engine = 0; } @@ -204,7 +204,7 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name { if (!obj) return; - QDeclarativeTypeNameCache *typeNameCache = context?QDeclarativeContextPrivate::get(context)->imports:0; + QDeclarativeTypeNameCache *typeNameCache = context?context->imports:0; QStringList path = name.split(QLatin1Char('.')); if (path.isEmpty()) return; @@ -924,7 +924,7 @@ bool QDeclarativePropertyPrivate::writeValueProperty(const QVariant &value, Writ } bool QDeclarativePropertyPrivate::write(QObject *object, const QDeclarativePropertyCache::Data &property, - const QVariant &value, QDeclarativeContext *context, + const QVariant &value, QDeclarativeContextData *context, WriteFlags flags) { int coreIdx = property.coreIndex; @@ -1305,7 +1305,7 @@ QByteArray QDeclarativePropertyPrivate::saveProperty(const QMetaObject *metaObje } QDeclarativeProperty -QDeclarativePropertyPrivate::restore(const QByteArray &data, QObject *object, QDeclarativeContext *ctxt) +QDeclarativePropertyPrivate::restore(const QByteArray &data, QObject *object, QDeclarativeContextData *ctxt) { QDeclarativeProperty prop; @@ -1314,7 +1314,7 @@ QDeclarativePropertyPrivate::restore(const QByteArray &data, QObject *object, QD prop.d->object = object; prop.d->context = ctxt; - prop.d->engine = ctxt?ctxt->engine():0; + prop.d->engine = ctxt->engine; const SerializedData *sd = (const SerializedData *)data.constData(); if (sd->isValueType) { |