QSqlError: misc cleanup
- fix formatting for qsqlerror.cpp/.h - replace a size() == 1 "x"_L1 with u'x' Pick-to: 6.5 Change-Id: I74c92f27be4345737fcfc73368f834a2f7920808 Reviewed-by: Marc Mutz <marc.mutz@qt.io>bb10
parent
e848dd14f5
commit
b5fe88a6e5
|
|
@ -103,7 +103,7 @@ QSqlError::QSqlError(const QString &driverText, const QString &databaseText,
|
|||
/*!
|
||||
Creates a copy of \a other.
|
||||
*/
|
||||
QSqlError::QSqlError(const QSqlError& other)
|
||||
QSqlError::QSqlError(const QSqlError &other)
|
||||
: d(new QSqlErrorPrivate(*other.d))
|
||||
{
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ QSqlError::QSqlError(const QSqlError& other)
|
|||
Assigns the \a other error's values to this error.
|
||||
*/
|
||||
|
||||
QSqlError& QSqlError::operator=(const QSqlError& other)
|
||||
QSqlError &QSqlError::operator=(const QSqlError &other)
|
||||
{
|
||||
if (&other == this)
|
||||
return *this;
|
||||
|
|
@ -129,7 +129,7 @@ QSqlError& QSqlError::operator=(const QSqlError& other)
|
|||
Compare the \a other error's values to this error and returns \c true, if it equal.
|
||||
*/
|
||||
|
||||
bool QSqlError::operator==(const QSqlError& other) const
|
||||
bool QSqlError::operator==(const QSqlError &other) const
|
||||
{
|
||||
return (d->errorType == other.d->errorType);
|
||||
}
|
||||
|
|
@ -139,7 +139,7 @@ bool QSqlError::operator==(const QSqlError& other) const
|
|||
Compare the \a other error's values to this error and returns \c true if it is not equal.
|
||||
*/
|
||||
|
||||
bool QSqlError::operator!=(const QSqlError& other) const
|
||||
bool QSqlError::operator!=(const QSqlError &other) const
|
||||
{
|
||||
return (d->errorType != other.d->errorType);
|
||||
}
|
||||
|
|
@ -209,7 +209,7 @@ QString QSqlError::nativeErrorCode() const
|
|||
QString QSqlError::text() const
|
||||
{
|
||||
QString result = d->databaseError;
|
||||
if (!d->databaseError.isEmpty() && !d->driverError.isEmpty() && !d->databaseError.endsWith("\n"_L1))
|
||||
if (!d->databaseError.isEmpty() && !d->driverError.isEmpty() && !d->databaseError.endsWith(u'\n'))
|
||||
result += u' ';
|
||||
result += d->driverError;
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -25,15 +25,15 @@ public:
|
|||
const QString &databaseText = QString(),
|
||||
ErrorType type = NoError,
|
||||
const QString &errorCode = QString());
|
||||
QSqlError(const QSqlError& other);
|
||||
QSqlError(const QSqlError &other);
|
||||
QSqlError(QSqlError &&other) noexcept : d(other.d) { other.d = nullptr; }
|
||||
QSqlError& operator=(const QSqlError& other);
|
||||
QSqlError& operator=(const QSqlError &other);
|
||||
QSqlError &operator=(QSqlError &&other) noexcept { swap(other); return *this; }
|
||||
|
||||
bool operator==(const QSqlError& other) const;
|
||||
bool operator!=(const QSqlError& other) const;
|
||||
~QSqlError();
|
||||
|
||||
bool operator==(const QSqlError &other) const;
|
||||
bool operator!=(const QSqlError &other) const;
|
||||
|
||||
void swap(QSqlError &other) noexcept { qt_ptr_swap(d, other.d); }
|
||||
|
||||
QString driverText() const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue