From 2c6593b721f809012e6b93ba4c4428b76e22adb3 Mon Sep 17 00:00:00 2001 From: Robert Szefner Date: Mon, 11 Mar 2019 23:36:26 +0100 Subject: QPSQL: Use nullptr for pointers Change-Id: I2b61cf0b81550c0878b0f06488a933c4b14e4728 Reviewed-by: Christian Ehrlicher --- src/plugins/sqldrivers/psql/qsql_psql.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 6476dd7839..c1be91cb22 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -321,7 +321,7 @@ public: }; static QSqlError qMakeError(const QString &err, QSqlError::ErrorType type, - const QPSQLDriverPrivate *p, PGresult *result = 0) + const QPSQLDriverPrivate *p, PGresult *result = nullptr) { const char *s = PQerrorMessage(p->connection); QString msg = p->isUtf8 ? QString::fromUtf8(s) : QString::fromLocal8Bit(s); @@ -1249,7 +1249,7 @@ bool QPSQLDriver::open(const QString &db, setLastError(qMakeError(tr("Unable to connect"), QSqlError::ConnectionError, d)); setOpenError(true); PQfinish(d->connection); - d->connection = 0; + d->connection = nullptr; return false; } @@ -1273,12 +1273,12 @@ void QPSQLDriver::close() if (d->sn) { disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int))); delete d->sn; - d->sn = 0; + d->sn = nullptr; } if (d->connection) PQfinish(d->connection); - d->connection = 0; + d->connection = nullptr; setOpen(false); setOpenError(false); } @@ -1663,7 +1663,7 @@ bool QPSQLDriver::unsubscribeFromNotification(const QString &name) if (d->seid.isEmpty()) { disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int))); delete d->sn; - d->sn = 0; + d->sn = nullptr; } return true; @@ -1681,8 +1681,8 @@ void QPSQLDriver::_q_handleNotification(int) d->pendingNotifyCheck = false; PQconsumeInput(d->connection); - PGnotify *notify = 0; - while ((notify = PQnotifies(d->connection)) != 0) { + PGnotify *notify = nullptr; + while ((notify = PQnotifies(d->connection)) != nullptr) { QString name(QLatin1String(notify->relname)); if (d->seid.contains(name)) { QString payload; -- cgit v1.2.3