diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2014-09-10 10:52:14 +0200 |
---|---|---|
committer | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2014-09-11 10:54:42 +0200 |
commit | fa9a407b9f7b89e4785c650dcb3e80d08ea3c042 (patch) | |
tree | 87a85efb95e21e248b95904b834370b956e804b6 /src/corelib/json/qjsonvalue.cpp | |
parent | 7b9f7f3891230ddd2b2ef5cf3c760a605a02ee96 (diff) |
Revert "Reading QJsonObject property should not modify the object itself."
This reverts commit 20cf632ad5f3ffe7b0fd231724c971f4e07304eb. The commit
produced to many problems during statics destruction. For example
causing QtCreator crash (QTBUG-40987).
Change-Id: Ib52f6a449c2d84deab2de792559a6a065ca45e8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/json/qjsonvalue.cpp')
-rw-r--r-- | src/corelib/json/qjsonvalue.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp index 6e40308de3..2d957070ab 100644 --- a/src/corelib/json/qjsonvalue.cpp +++ b/src/corelib/json/qjsonvalue.cpp @@ -673,10 +673,11 @@ void QJsonValue::detach() However, they are not explicitly documented here. */ + QJsonValueRef &QJsonValueRef::operator =(const QJsonValue &val) { if (is_object) - UnionHelper::setValueAt(this, val); + o->setValueAt(index, val); else a->replace(index, val); @@ -686,7 +687,7 @@ QJsonValueRef &QJsonValueRef::operator =(const QJsonValue &val) QJsonValueRef &QJsonValueRef::operator =(const QJsonValueRef &ref) { if (is_object) - UnionHelper::setValueAt(this, ref); + o->setValueAt(index, ref); else a->replace(index, ref); @@ -707,7 +708,7 @@ QJsonValue QJsonValueRef::toValue() const { if (!is_object) return a->at(index); - return UnionHelper::valueAt(this); + return o->valueAt(index); } #if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY) |