diff options
Diffstat (limited to 'src/sql/drivers')
-rw-r--r-- | src/sql/drivers/ibase/qsql_ibase.cpp | 4 | ||||
-rw-r--r-- | src/sql/drivers/psql/qsql_psql.cpp | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index 7a98803efc..1109dfd62a 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -1845,8 +1845,10 @@ void QIBaseDriver::qHandleEventNotification(void *updatedResultBuffer) isc_event_counts(counts, eBuffer->bufferLength, eBuffer->eventBuffer, eBuffer->resultBuffer); if (counts[0]) { - if (eBuffer->subscriptionState == QIBaseEventBuffer::Subscribed) + if (eBuffer->subscriptionState == QIBaseEventBuffer::Subscribed) { emit notification(i.key()); + emit notification(i.key(), QSqlDriver::UnknownSource); + } else if (eBuffer->subscriptionState == QIBaseEventBuffer::Starting) eBuffer->subscriptionState = QIBaseEventBuffer::Subscribed; diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 8985184e13..e3533581ba 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1370,8 +1370,13 @@ void QPSQLDriver::_q_handleNotification(int) PGnotify *notify = 0; while((notify = PQnotifies(d->connection)) != 0) { QString name(QLatin1String(notify->relname)); - if (d->seid.contains(name)) + if (d->seid.contains(name)) { emit notification(name); + if (notify->be_pid == PQbackendPID(d->connection)) + emit notification(name, QSqlDriver::SelfSource); + else + emit notification(name, QSqlDriver::OtherSource); + } else qWarning("QPSQLDriver: received notification for '%s' which isn't subscribed to.", qPrintable(name)); |