QPSQL: Use nullptr for pointers
Change-Id: I2b61cf0b81550c0878b0f06488a933c4b14e4728 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit is contained in:
parent
3fa5e637fb
commit
2c6593b721
@ -321,7 +321,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
static QSqlError qMakeError(const QString &err, QSqlError::ErrorType type,
|
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);
|
const char *s = PQerrorMessage(p->connection);
|
||||||
QString msg = p->isUtf8 ? QString::fromUtf8(s) : QString::fromLocal8Bit(s);
|
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));
|
setLastError(qMakeError(tr("Unable to connect"), QSqlError::ConnectionError, d));
|
||||||
setOpenError(true);
|
setOpenError(true);
|
||||||
PQfinish(d->connection);
|
PQfinish(d->connection);
|
||||||
d->connection = 0;
|
d->connection = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1273,12 +1273,12 @@ void QPSQLDriver::close()
|
|||||||
if (d->sn) {
|
if (d->sn) {
|
||||||
disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int)));
|
disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int)));
|
||||||
delete d->sn;
|
delete d->sn;
|
||||||
d->sn = 0;
|
d->sn = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d->connection)
|
if (d->connection)
|
||||||
PQfinish(d->connection);
|
PQfinish(d->connection);
|
||||||
d->connection = 0;
|
d->connection = nullptr;
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
setOpenError(false);
|
setOpenError(false);
|
||||||
}
|
}
|
||||||
@ -1663,7 +1663,7 @@ bool QPSQLDriver::unsubscribeFromNotification(const QString &name)
|
|||||||
if (d->seid.isEmpty()) {
|
if (d->seid.isEmpty()) {
|
||||||
disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int)));
|
disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int)));
|
||||||
delete d->sn;
|
delete d->sn;
|
||||||
d->sn = 0;
|
d->sn = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1681,8 +1681,8 @@ void QPSQLDriver::_q_handleNotification(int)
|
|||||||
d->pendingNotifyCheck = false;
|
d->pendingNotifyCheck = false;
|
||||||
PQconsumeInput(d->connection);
|
PQconsumeInput(d->connection);
|
||||||
|
|
||||||
PGnotify *notify = 0;
|
PGnotify *notify = nullptr;
|
||||||
while ((notify = PQnotifies(d->connection)) != 0) {
|
while ((notify = PQnotifies(d->connection)) != nullptr) {
|
||||||
QString name(QLatin1String(notify->relname));
|
QString name(QLatin1String(notify->relname));
|
||||||
if (d->seid.contains(name)) {
|
if (d->seid.contains(name)) {
|
||||||
QString payload;
|
QString payload;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user