summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Szefner <r.szefner@hydro-partner.pl>2019-03-11 23:36:26 +0100
committerAapo Keskimolo <aapo.keskimolo@qt.io>2019-03-13 10:57:19 +0000
commit2c6593b721f809012e6b93ba4c4428b76e22adb3 (patch)
treefed20c6e3a7b04e66421c62141a3c9a593cf87da
parent3fa5e637fb45ae6868422494f5a17c0c8fc68ab2 (diff)
QPSQL: Use nullptr for pointers
Change-Id: I2b61cf0b81550c0878b0f06488a933c4b14e4728 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql.cpp14
1 files 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;