diff options
author | Derick Hawcroft <derick.hawcroft@nokia.com> | 2009-07-07 04:44:52 (GMT) |
---|---|---|
committer | Derick Hawcroft <derick.hawcroft@nokia.com> | 2009-07-07 04:44:52 (GMT) |
commit | 3814b2adf50b5724e3375ea2048d13960c8aed82 (patch) | |
tree | c14b4927867d2745039b7568f66a38fb92ffddf7 /src/sql/drivers | |
parent | 283b1ba1cf6cd34d07d9f2b2bb0d40223e172339 (diff) | |
download | Qt-3814b2adf50b5724e3375ea2048d13960c8aed82.zip Qt-3814b2adf50b5724e3375ea2048d13960c8aed82.tar.gz Qt-3814b2adf50b5724e3375ea2048d13960c8aed82.tar.bz2 |
Handle all PostgreSQL notifications sitting in the queue
Task-number: 257247
Reviewed-by: trustme
Diffstat (limited to 'src/sql/drivers')
-rw-r--r-- | src/sql/drivers/psql/qsql_psql.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 770df4c..69697da 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1248,15 +1248,15 @@ QStringList QPSQLDriver::subscribedToNotificationsImplementation() const void QPSQLDriver::_q_handleNotification(int) { PQconsumeInput(d->connection); - PGnotify *notify = PQnotifies(d->connection); - if (notify) { - QString name(QLatin1String(notify->relname)); + PGnotify *notify = 0; + while((notify = PQnotifies(d->connection)) != 0) { + QString name(QLatin1String(notify->relname)); if (d->seid.contains(name)) emit notification(name); else qWarning("QPSQLDriver: received notification for '%s' which isn't subscribed to.", - qPrintable(name)); + qPrintable(name)); qPQfreemem(notify); } |