diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-02 10:49:55 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-02 10:49:55 (GMT) |
commit | e76a5a08e4e46a49a28e6aa338c4a27acc715dc2 (patch) | |
tree | d2543adfeaf56663ace84bf59bc22211dac687d8 /src/corelib/kernel | |
parent | 9a90dab23bd1bd37bd4a7aace588896d2ae7e9d9 (diff) | |
parent | 200286b8e83918e785b61e4695443a3b77ebeaea (diff) | |
download | Qt-e76a5a08e4e46a49a28e6aa338c4a27acc715dc2.zip Qt-e76a5a08e4e46a49a28e6aa338c4a27acc715dc2.tar.gz Qt-e76a5a08e4e46a49a28e6aa338c4a27acc715dc2.tar.bz2 |
Merge branch 'research/qdbus-improvements'
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 215f6ae..3184244 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -2136,8 +2136,15 @@ QVariant QMetaProperty::read(const QObject *object) const return QVariant(); } } + + // the status variable is changed by qt_metacall to indicate what it did + // this feature is currently only used by QtDBus and should not be depended + // upon. Don't change it without looking into QDBusAbstractInterface first + // -1 (unchanged): normal qt_metacall, result stored in argv[0] + // changed: result stored directly in value + int status = -1; QVariant value; - void *argv[2] = { 0, &value }; + void *argv[] = { 0, &value, &status }; if (t == QVariant::LastType) { argv[0] = &value; } else { @@ -2147,8 +2154,8 @@ QVariant QMetaProperty::read(const QObject *object) const const_cast<QObject*>(object)->qt_metacall(QMetaObject::ReadProperty, idx + mobj->propertyOffset(), argv); - if (argv[1] == 0) - // "value" was changed + + if (status != -1) return value; if (t != QVariant::LastType && argv[0] != value.data()) // pointer or reference @@ -2206,13 +2213,19 @@ bool QMetaProperty::write(QObject *object, const QVariant &value) const return false; } - void *argv[2] = { 0, &v }; + // the status variable is changed by qt_metacall to indicate what it did + // this feature is currently only used by QtDBus and should not be depended + // upon. Don't change it without looking into QDBusAbstractInterface first + // -1 (unchanged): normal qt_metacall, result stored in argv[0] + // changed: result stored directly in value, return the value of status + int status = -1; + void *argv[] = { 0, &v, &status }; if (t == QVariant::LastType) argv[0] = &v; else argv[0] = v.data(); object->qt_metacall(QMetaObject::WriteProperty, idx + mobj->propertyOffset(), argv); - return true; + return status; } /*! |