summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerick Hawcroft <derick.hawcroft@nokia.com>2009-07-07 14:44:52 +1000
committerDerick Hawcroft <derick.hawcroft@nokia.com>2009-07-07 14:44:52 +1000
commit3814b2adf50b5724e3375ea2048d13960c8aed82 (patch)
treec14b4927867d2745039b7568f66a38fb92ffddf7
parent283b1ba1cf6cd34d07d9f2b2bb0d40223e172339 (diff)
Handle all PostgreSQL notifications sitting in the queue
Task-number: 257247 Reviewed-by: trustme
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp8
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 770df4c76e..69697da7d3 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);
}