diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-05-07 12:56:58 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-07 13:09:56 +0200 |
commit | 76a173c8be3eaf9c4468fd076d6ec9b334bf2f31 (patch) | |
tree | 19935fab6619505c69bd6c9d42a16fcc3925320a /src/qml | |
parent | 0ae4fb4647d6b286805e01763341c126000155ea (diff) |
Rename Value::deletedValue() to Value::emptyValue()
This reflects a bit better how this special value is being used.
Change-Id: I136c8ab648bf82102fb2627e17c574a980c4d5ff
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlboundsignal.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertycache.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4isel_util_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4mm.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4object.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4object_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4objectproto.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4property_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4runtime.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4value_p.h | 12 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalue_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8bindings.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8engine.cpp | 4 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8qobjectwrapper.cpp | 2 |
15 files changed, 25 insertions, 25 deletions
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index ff61fdede3..d84d7a492d 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -206,7 +206,7 @@ void QQmlBoundSignalExpression::evaluate(void **a) m_fileName, m_line, &m_v8qmlscope); } - if (m_v8function->isDeleted() || m_v8function->isNull()) { + if (m_v8function->isEmpty() || m_v8function->isNull()) { ep->dereferenceScarceResources(); return; // could not evaluate function. Not valid. } diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index c2ad069391..df3d558cb4 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -290,8 +290,8 @@ QQmlPropertyCache::~QQmlPropertyCache() void QQmlPropertyCache::destroy() { - Q_ASSERT(engine || constructor->isDeleted()); - if (constructor->isDeleted()) + Q_ASSERT(engine || constructor->isEmpty()); + if (constructor->isEmpty()) delete this; else QQmlEnginePrivate::deleteInEngineThread(engine, this); @@ -598,7 +598,7 @@ void QQmlPropertyCache::append(QQmlEngine *engine, const QMetaObject *metaObject QQmlPropertyData::Flag signalFlags) { Q_UNUSED(revision); - Q_ASSERT(constructor->isDeleted()); // We should not be appending to an in-use property cache + Q_ASSERT(constructor->isEmpty()); // We should not be appending to an in-use property cache _metaObject = metaObject; diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index 9121f138b2..37adaad57a 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -972,7 +972,7 @@ v8::Handle<v8::Function> QQmlVMEMetaObject::method(int index) if (!v8methods) v8methods = new QV4::PersistentValue[metaData->methodCount]; - if (v8methods[index]->isDeleted()) { + if (v8methods[index]->isEmpty()) { QQmlVMEMetaData::MethodData *data = metaData->methodData() + index; const char *body = ((const char*)metaData) + data->bodyOffset; diff --git a/src/qml/qml/v4/qv4isel_util_p.h b/src/qml/qml/v4/qv4isel_util_p.h index 54e646402f..a696f051e4 100644 --- a/src/qml/qml/v4/qv4isel_util_p.h +++ b/src/qml/qml/v4/qv4isel_util_p.h @@ -51,7 +51,7 @@ inline QV4::Value convertToValue(V4IR::Const *c) { switch (c->type) { case V4IR::MissingType: - return QV4::Value::deletedValue(); + return QV4::Value::emptyValue(); case V4IR::NullType: return QV4::Value::nullValue(); case V4IR::UndefinedType: diff --git a/src/qml/qml/v4/qv4mm.cpp b/src/qml/qml/v4/qv4mm.cpp index b400415c25..9c0e4ad1e0 100644 --- a/src/qml/qml/v4/qv4mm.cpp +++ b/src/qml/qml/v4/qv4mm.cpp @@ -400,7 +400,7 @@ MemoryManager::~MemoryManager() PersistentValuePrivate *persistent = m_persistentValues; while (persistent) { PersistentValuePrivate *n = persistent->next; - persistent->value = Value::deletedValue(); + persistent->value = Value::emptyValue(); persistent->prev = 0; persistent->next = 0; persistent = n; diff --git a/src/qml/qml/v4/qv4object.cpp b/src/qml/qml/v4/qv4object.cpp index 19b5146c81..9a3d15fd1a 100644 --- a/src/qml/qml/v4/qv4object.cpp +++ b/src/qml/qml/v4/qv4object.cpp @@ -1136,7 +1136,7 @@ void Object::arrayReserve(uint n) arrayData = newArrayData; if (sparseArray) { for (uint i = arrayFreeList; i < arrayAlloc; ++i) { - arrayData[i].value = Value::deletedValue(); + arrayData[i].value = Value::emptyValue(); arrayData[i].value = Value::fromInt32(i + 1); } } else { @@ -1193,7 +1193,7 @@ bool Object::setArrayLength(uint newLen) { arrayAttributes[it->value].clear(); } } - pd.value.tag = Value::_Deleted_Type; + pd.value.tag = Value::_Empty_Type; pd.value.int_32 = arrayFreeList; arrayFreeList = it->value; bool brk = (it == begin); @@ -1216,7 +1216,7 @@ bool Object::setArrayLength(uint newLen) { } else { arrayAttributes[it - arrayData].clear(); } - it->value = Value::deletedValue(); + it->value = Value::emptyValue(); } } arrayDataLen = newLen; diff --git a/src/qml/qml/v4/qv4object_p.h b/src/qml/qml/v4/qv4object_p.h index ac5ca07a01..e1cf57c513 100644 --- a/src/qml/qml/v4/qv4object_p.h +++ b/src/qml/qml/v4/qv4object_p.h @@ -197,7 +197,7 @@ struct Q_QML_EXPORT Object: Managed { } void freeArrayValue(int idx) { Property &pd = arrayData[idx]; - pd.value.tag = Value::_Deleted_Type; + pd.value.tag = Value::_Empty_Type; pd.value.int_32 = arrayFreeList; arrayFreeList = idx; if (arrayAttributes) diff --git a/src/qml/qml/v4/qv4objectproto.cpp b/src/qml/qml/v4/qv4objectproto.cpp index f395268feb..3803d429c7 100644 --- a/src/qml/qml/v4/qv4objectproto.cpp +++ b/src/qml/qml/v4/qv4objectproto.cpp @@ -531,7 +531,7 @@ void ObjectPrototype::toPropertyDescriptor(ExecutionContext *ctx, Value v, Prope } if (attrs->isGeneric()) - desc->value = Value::deletedValue(); + desc->value = Value::emptyValue(); } diff --git a/src/qml/qml/v4/qv4property_p.h b/src/qml/qml/v4/qv4property_p.h index 2a3c5bf976..8598d8134d 100644 --- a/src/qml/qml/v4/qv4property_p.h +++ b/src/qml/qml/v4/qv4property_p.h @@ -89,7 +89,7 @@ struct Property { static Property genericDescriptor() { Property pd; - pd.value = Value::deletedValue(); + pd.value = Value::emptyValue(); return pd; } diff --git a/src/qml/qml/v4/qv4runtime.cpp b/src/qml/qml/v4/qv4runtime.cpp index d21399a481..ae2c0d1c91 100644 --- a/src/qml/qml/v4/qv4runtime.cpp +++ b/src/qml/qml/v4/qv4runtime.cpp @@ -1238,7 +1238,7 @@ void __qmljs_builtin_define_array(ExecutionContext *ctx, Value *array, Value *va a->arrayDataLen = length; Property *pd = a->arrayData; for (uint i = 0; i < length; ++i) { - if (values[i].isDeleted()) { + if (values[i].isEmpty()) { a->ensureArrayAttributes(); pd->value = Value::undefinedValue(); a->arrayAttributes[i].clear(); diff --git a/src/qml/qml/v4/qv4value_p.h b/src/qml/qml/v4/qv4value_p.h index 9e56df0db6..1d2285cbc7 100644 --- a/src/qml/qml/v4/qv4value_p.h +++ b/src/qml/qml/v4/qv4value_p.h @@ -121,7 +121,7 @@ struct Q_QML_EXPORT Value enum ValueTypeInternal { _Undefined_Type = Undefined_Type, - _Deleted_Type = Deleted_Type, + _Empty_Type = Deleted_Type, _Null_Type = Null_Type | ConvertibleToInt, _Boolean_Type = Boolean_Type | ConvertibleToInt, _Integer_Type = Integer_Type | ConvertibleToInt, @@ -135,7 +135,7 @@ struct Q_QML_EXPORT Value } // used internally in property - inline bool isDeleted() const { return tag == _Deleted_Type; } + inline bool isEmpty() const { return tag == _Empty_Type; } inline bool isUndefined() const { return tag == _Undefined_Type; } inline bool isNull() const { return tag == _Null_Type; } @@ -196,7 +196,7 @@ struct Q_QML_EXPORT Value return val; } - static Value deletedValue(); + static Value emptyValue(); static Value undefinedValue(); static Value nullValue(); static Value fromBoolean(Bool b); @@ -313,10 +313,10 @@ inline Value Value::nullValue() return v; } -inline Value Value::deletedValue() +inline Value Value::emptyValue() { Value v; - v.tag = Value::_Deleted_Type; + v.tag = Value::_Empty_Type; v.uint_32 = 0; return v; } @@ -552,7 +552,7 @@ inline Value Managed::call(ExecutionContext *context, const Value &thisObject, V struct PersistentValuePrivate { PersistentValuePrivate() - : value(Value::deletedValue()) + : value(Value::emptyValue()) , refcount(1) , prev(0) , next(0) diff --git a/src/qml/qml/v8/qjsvalue_p.h b/src/qml/qml/v8/qjsvalue_p.h index 441ab1a04a..ab8572baf9 100644 --- a/src/qml/qml/v8/qjsvalue_p.h +++ b/src/qml/qml/v8/qjsvalue_p.h @@ -70,7 +70,7 @@ public: QJSValuePrivate(const QV4::Value &v) : PersistentValuePrivate(v) { - if (value.isDeleted()) + if (value.isEmpty()) value = QV4::Value::undefinedValue(); } QJSValuePrivate(QV4::Object *o) diff --git a/src/qml/qml/v8/qv8bindings.cpp b/src/qml/qml/v8/qv8bindings.cpp index ebd3451958..a17f2a732a 100644 --- a/src/qml/qml/v8/qv8bindings.cpp +++ b/src/qml/qml/v8/qv8bindings.cpp @@ -245,7 +245,7 @@ QV8Bindings::QV8Bindings(QQmlCompiledData::V8Program *program, { QV8Engine *engine = QQmlEnginePrivate::getV8Engine(context->engine); - if (program->bindings->isDeleted()) { + if (program->bindings->isEmpty()) { v8::Handle<v8::Script> script; bool compileFailed = false; { diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 6b6fe7b94c..a70b04d5b4 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -192,7 +192,7 @@ QV8Engine::~QV8Engine() QVariant QV8Engine::toVariant(const QV4::Value &value, int typeHint) { - if (value.isDeleted()) + if (value.isEmpty()) return QVariant(); if (typeHint == QVariant::Bool) @@ -1255,7 +1255,7 @@ QV4::Value QV8Engine::variantToJS(const QVariant &value) QVariant QV8Engine::variantFromJS(const QV4::Value &value, V8ObjectSet &visitedObjects) { - Q_ASSERT(!value.isDeleted()); + Q_ASSERT(!value.isEmpty()); if (value.isUndefined()) return QVariant(); if (value.isNull()) diff --git a/src/qml/qml/v8/qv8qobjectwrapper.cpp b/src/qml/qml/v8/qv8qobjectwrapper.cpp index aa22156ae3..e25b8b478b 100644 --- a/src/qml/qml/v8/qv8qobjectwrapper.cpp +++ b/src/qml/qml/v8/qv8qobjectwrapper.cpp @@ -961,7 +961,7 @@ v8::Handle<v8::Object> QQmlPropertyCache::newQObject(QObject *object, QV8Engine Q_ASSERT(QQmlData::get(object, false)->propertyCache == this); // Setup constructor - if (constructor->isDeleted()) { + if (constructor->isEmpty()) { v8::Handle<v8::FunctionTemplate> ft; const QHashedString toString(QStringLiteral("toString")); |