QSqlError: Remove unused members, kept for binary compatibility

Also optimize the construction of QSqlErrorPrivate.

Change-Id: I791ebe0b66fab43e74093186a798ef9656f97dbd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Marcel Krems 2018-11-19 19:13:15 +01:00
parent cba147d359
commit 49efc168e1
2 changed files with 3 additions and 16 deletions

View File

@ -128,9 +128,8 @@ public:
*/ */
QSqlError::QSqlError(const QString &driverText, const QString &databaseText, QSqlError::QSqlError(const QString &driverText, const QString &databaseText,
ErrorType type, const QString &code) ErrorType type, const QString &code)
: d(new QSqlErrorPrivate)
{ {
d = new QSqlErrorPrivate;
d->driverError = driverText; d->driverError = driverText;
d->databaseError = databaseText; d->databaseError = databaseText;
d->errorType = type; d->errorType = type;
@ -142,10 +141,8 @@ QSqlError::QSqlError(const QString &driverText, const QString &databaseText,
Creates a copy of \a other. Creates a copy of \a other.
*/ */
QSqlError::QSqlError(const QSqlError& other) QSqlError::QSqlError(const QSqlError& other)
: d(new QSqlErrorPrivate(*other.d))
{ {
d = new QSqlErrorPrivate;
*d = *other.d;
} }
/*! /*!

View File

@ -80,17 +80,7 @@ public:
bool isValid() const; bool isValid() const;
private: private:
// ### Qt6: Keep the pointer and remove the rest. QSqlErrorPrivate *d = nullptr;
QString unused1;
QString unused2;
struct Unused {
ErrorType unused3;
int unused4;
};
union {
QSqlErrorPrivate *d;
Unused unused5;
};
}; };
Q_DECLARE_SHARED(QSqlError) Q_DECLARE_SHARED(QSqlError)