QJsonDocumentPrivate: remove unused rawData{,Size} member variables
This is a followup to commit a6b3a1e4598f829b1b60407b2e47417db6f0e442 from 2020. Found while writing gdb pretty printers for QJsonDocument and friends. Change-Id: I223751003198dc9aab3f4b108d070296bb8112db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
9b0970ad82
commit
d52506e262
@ -56,24 +56,8 @@ class QJsonDocumentPrivate
|
|||||||
public:
|
public:
|
||||||
QJsonDocumentPrivate() = default;
|
QJsonDocumentPrivate() = default;
|
||||||
QJsonDocumentPrivate(QCborValue data) : value(std::move(data)) {}
|
QJsonDocumentPrivate(QCborValue data) : value(std::move(data)) {}
|
||||||
~QJsonDocumentPrivate()
|
|
||||||
{
|
|
||||||
if (rawData)
|
|
||||||
free(rawData);
|
|
||||||
}
|
|
||||||
|
|
||||||
QCborValue value;
|
QCborValue value;
|
||||||
char *rawData = nullptr;
|
|
||||||
uint rawDataSize = 0;
|
|
||||||
|
|
||||||
void clearRawData()
|
|
||||||
{
|
|
||||||
if (rawData) {
|
|
||||||
free(rawData);
|
|
||||||
rawData = nullptr;
|
|
||||||
rawDataSize = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -152,8 +136,6 @@ QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other)
|
|||||||
if (other.d) {
|
if (other.d) {
|
||||||
if (!d)
|
if (!d)
|
||||||
d = std::make_unique<QJsonDocumentPrivate>();
|
d = std::make_unique<QJsonDocumentPrivate>();
|
||||||
else
|
|
||||||
d->clearRawData();
|
|
||||||
d->value = other.d->value;
|
d->value = other.d->value;
|
||||||
} else {
|
} else {
|
||||||
d.reset();
|
d.reset();
|
||||||
@ -375,8 +357,6 @@ void QJsonDocument::setObject(const QJsonObject &object)
|
|||||||
{
|
{
|
||||||
if (!d)
|
if (!d)
|
||||||
d = std::make_unique<QJsonDocumentPrivate>();
|
d = std::make_unique<QJsonDocumentPrivate>();
|
||||||
else
|
|
||||||
d->clearRawData();
|
|
||||||
|
|
||||||
d->value = QCborValue::fromJsonValue(object);
|
d->value = QCborValue::fromJsonValue(object);
|
||||||
}
|
}
|
||||||
@ -390,8 +370,6 @@ void QJsonDocument::setArray(const QJsonArray &array)
|
|||||||
{
|
{
|
||||||
if (!d)
|
if (!d)
|
||||||
d = std::make_unique<QJsonDocumentPrivate>();
|
d = std::make_unique<QJsonDocumentPrivate>();
|
||||||
else
|
|
||||||
d->clearRawData();
|
|
||||||
|
|
||||||
d->value = QCborValue::fromJsonValue(array);
|
d->value = QCborValue::fromJsonValue(array);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user