diff options
author | Simon Hausmann <[email protected]> | 2013-09-13 09:08:41 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-09-20 14:26:09 +0200 |
commit | 5c4c9123917fb411598807cd9bb855b9aa1fa832 (patch) | |
tree | 7b6b35a69ba0821fb38494dda277ee981925239a /src/qml/compiler/qv4compileddata_p.h | |
parent | 3ec5aae38e77d370d1a23efe4b924ee4762a2238 (diff) |
Cleanup: Fold CompiledData::Value into CompiledData::Binding
Value isn't needed anywhere else
Change-Id: Ib12d85332a6096e6232a790a7e6fd63961329e3b
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 9f8bd80f4d..e8d2a73278 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -241,8 +241,10 @@ struct Function // Qml data structures -struct Value +struct Binding { + quint32 propertyNameIndex; + enum ValueType { Type_Invalid, Type_Boolean, @@ -258,14 +260,24 @@ struct Value double d; quint32 compiledScriptIndex; // used when Type_Script quint32 objectIndex; - }; + } value; quint32 stringIndex; // Set for Type_String and Type_Script (the latter because of script strings) -}; -struct Binding -{ - quint32 propertyNameIndex; - Value value; + QString valueAsString(const Unit *unit) const; + double valueAsNumber() const + { + if (type == Type_Number) + return value.d; + return 0.0; + + } + bool valueAsBoolean() const + { + if (type == Type_Boolean) + return value.b; + return false; + } + }; struct Parameter |