From f75b851a59115fb84ffc0680816cb900c3c2bd55 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 9 Jan 2012 12:24:44 +0100 Subject: Fixed the remaining API issues in QJsonValue Removed all setFoo() methods and made detach() private. Change-Id: Ie84dc0a46bf19153745b5412feaf00b8957a7a8f Sanity-Review: Qt Sanity Bot Reviewed-by: Simon Hausmann --- src/qjsonvalue.cpp | 35 ----------------------------------- src/qjsonvalue.h | 14 ++------------ 2 files changed, 2 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/qjsonvalue.cpp b/src/qjsonvalue.cpp index 25dfebf..5f598d7 100644 --- a/src/qjsonvalue.cpp +++ b/src/qjsonvalue.cpp @@ -241,41 +241,6 @@ QVariant QJsonValue::toVariant() const QJsonValue::Type QJsonValue::type() const { return t; - } - -void QJsonValue::setValue(bool b) -{ - *this = QJsonValue(b); -} - -void QJsonValue::setValue(double d) -{ - *this = QJsonValue(d); -} - -void QJsonValue::setValue(int i) -{ - *this = QJsonValue(i); -} - -void QJsonValue::setValue(const QString &s) -{ - *this = QJsonValue(s); -} - -void QJsonValue::setValue(const QLatin1String &s) -{ - *this = QJsonValue(s); -} - -void QJsonValue::setValue(const QJsonArray &a) -{ - *this = QJsonValue(a); -} - -void QJsonValue::setValue(const QJsonObject &o) -{ - *this = QJsonValue(o); } bool QJsonValue::toBool() const diff --git a/src/qjsonvalue.h b/src/qjsonvalue.h index 6b677b4..38335fc 100644 --- a/src/qjsonvalue.h +++ b/src/qjsonvalue.h @@ -86,15 +86,6 @@ public: inline bool isObject() const { return type() == Object; } inline bool isUndefined() const { return type() == Undefined; } - // ### remove! - void setValue(bool); - void setValue(double); - void setValue(int); - void setValue(const QString &); - void setValue(const QLatin1String &); - void setValue(const QJsonArray &); - void setValue(const QJsonObject &); - bool toBool() const; double toNumber() const; int toInt() const; @@ -105,9 +96,6 @@ public: bool operator==(const QJsonValue &other) const; bool operator!=(const QJsonValue &other) const; - // ### make private - void detach(); - private: // avoid implicit conversions from char * to bool inline QJsonValue(const void *) {} @@ -117,6 +105,8 @@ private: friend class QJsonObject; QJsonValue(Private::Data *d, Private::Base *b, const Private::Value& v); + void detach(); + // ### These should move to Private::Value int requiredStorage(bool *compressed) const; uint valueToStore(uint offset) const; -- cgit v1.2.3