summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-02-23 02:41:24 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-02-23 02:42:06 (GMT)
commit5955a7bd3bcef20558238e2de0c66fac9eccdf57 (patch)
tree510c8660dac21bcfe1b46b304d0163eba28c4210 /src/declarative/qml
parentc41f7c7a4dbb2ac0c76e20628aaedeabec6f4497 (diff)
downloadQt-5955a7bd3bcef20558238e2de0c66fac9eccdf57.zip
Qt-5955a7bd3bcef20558238e2de0c66fac9eccdf57.tar.gz
Qt-5955a7bd3bcef20558238e2de0c66fac9eccdf57.tar.bz2
Small QmlMetaProperty code cleanup
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index 7c273dc..332d126 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -811,22 +811,22 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
return writeEnumProperty(prop, coreIdx, object, v, flags);
}
- int t = property.propType;
- int vt = value.userType();
+ int propertyType = property.propType;
+ int variantType = value.userType();
QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(context);
- if (t == QVariant::Url) {
+ if (propertyType == QVariant::Url) {
QUrl u;
bool found = false;
- if (vt == QVariant::Url) {
+ if (variantType == QVariant::Url) {
u = value.toUrl();
found = true;
- } else if (vt == QVariant::ByteArray) {
+ } else if (variantType == QVariant::ByteArray) {
u = QUrl(QString::fromUtf8(value.toByteArray()));
found = true;
- } else if (vt == QVariant::String) {
+ } else if (variantType == QVariant::String) {
u = QUrl(value.toString());
found = true;
}
@@ -840,12 +840,12 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
void *argv[] = { &u, 0, &status, &flags };
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, argv);
- } else if (vt == t) {
+ } else if (variantType == propertyType) {
void *a[] = { (void *)value.constData(), 0, &status, &flags };
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
- } else if (qMetaTypeId<QVariant>() == t) {
+ } else if (qMetaTypeId<QVariant>() == propertyType) {
void *a[] = { (void *)&value, 0, &status, &flags };
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
@@ -858,7 +858,7 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
return false;
QObject *o = *(QObject **)value.constData();
- const QMetaObject *propMo = rawMetaObjectForType(enginePriv, t);
+ const QMetaObject *propMo = rawMetaObjectForType(enginePriv, propertyType);
if (o) valMo = o->metaObject();
@@ -914,25 +914,25 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
}
} else {
- Q_ASSERT(vt != t);
+ Q_ASSERT(variantType != propertyType);
QVariant v = value;
- if (v.convert((QVariant::Type)t)) {
+ if (v.convert((QVariant::Type)propertyType)) {
void *a[] = { (void *)v.constData(), 0, &status, &flags};
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
- } else if ((uint)t >= QVariant::UserType && vt == QVariant::String) {
- QmlMetaType::StringConverter con = QmlMetaType::customStringConverter(t);
+ } else if ((uint)propertyType >= QVariant::UserType && variantType == QVariant::String) {
+ QmlMetaType::StringConverter con = QmlMetaType::customStringConverter(propertyType);
if (!con)
return false;
QVariant v = con(value.toString());
- if (v.userType() == t) {
+ if (v.userType() == propertyType) {
void *a[] = { (void *)v.constData(), 0, &status, &flags};
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
}
- } else if (vt == QVariant::String) {
+ } else if (variantType == QVariant::String) {
bool ok = false;
- QVariant v = QmlStringConverters::variantFromString(value.toString(), t, &ok);
+ QVariant v = QmlStringConverters::variantFromString(value.toString(), propertyType, &ok);
if (!ok)
return false;