From b5fe88a6e5251251d0f65b2f9cb5b28c01cc3b63 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 31 Mar 2023 20:05:48 +0200 Subject: [PATCH] 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 --- src/sql/kernel/qsqlerror.cpp | 10 +++++----- src/sql/kernel/qsqlerror.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp index 7f56357c10..1e093c236c 100644 --- a/src/sql/kernel/qsqlerror.cpp +++ b/src/sql/kernel/qsqlerror.cpp @@ -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; diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h index 6532f1af57..2a139d3316 100644 --- a/src/sql/kernel/qsqlerror.h +++ b/src/sql/kernel/qsqlerror.h @@ -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;