summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/blackberry/qbbengine.h
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-06-23 21:48:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-20 18:34:08 +0200
commit1603ba23656c8c31dc05fe9b3f1e12b22e29989a (patch)
tree5e507db7a34023b9236c982257923a2242c1693a /src/plugins/bearer/blackberry/qbbengine.h
parent981ea7a1aa602cebfdd43b7dc6efd3abf5a1cba3 (diff)
Provide public API for native event filtering, moved up from QPA.
The previous API was hard to use (global function, no type safety, manual chaining), and confusing (app vs dispatcher split only made sense on Windows). Installing and removing out of order would have the risk of setting back a dangling pointer (crash). Meanwhile QPA added type safety, and this new API models the QObject::installEventFilter API for ease of use. The virtual method is in a new interface, QAbstractNativeEventFilter. QPA was even calling the dispatcher event filter with QPA-private event classes, which made no sense (refactoring leftover from when the code was in the dispatcher). Now the QPA plugins trigger the qcoreapp event filters with the actual native events directly. Change-Id: Ie35e47c59c862383bcaf857b28d54f7c72547882 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Diffstat (limited to 'src/plugins/bearer/blackberry/qbbengine.h')
-rw-r--r--src/plugins/bearer/blackberry/qbbengine.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/bearer/blackberry/qbbengine.h b/src/plugins/bearer/blackberry/qbbengine.h
index 1c9a5d4aa5..2ad0f1fc65 100644
--- a/src/plugins/bearer/blackberry/qbbengine.h
+++ b/src/plugins/bearer/blackberry/qbbengine.h
@@ -45,6 +45,7 @@
#include "../qbearerengine_impl.h"
#include <QAbstractEventDispatcher>
+#include <QAbstractNativeEventFilter>
#ifndef QT_NO_BEARERMANAGEMENT
@@ -55,7 +56,7 @@ QT_BEGIN_NAMESPACE
class QNetworkConfigurationPrivate;
class QNetworkSessionPrivate;
-class QBBEngine : public QBearerEngineImpl
+class QBBEngine : public QBearerEngineImpl, public QAbstractNativeEventFilter
{
Q_OBJECT
@@ -82,6 +83,8 @@ public:
bool requiresPolling() const Q_DECL_OVERRIDE;
+ bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
+
protected:
void updateConfiguration(const char *interface);
void removeConfiguration(const QString &id);
@@ -90,14 +93,8 @@ private Q_SLOTS:
void doRequestUpdate();
private:
- static bool filterEvent(void *message);
-
- void filterEvent(bps_event_t *event);
-
QHash<QString, QString> configurationInterface;
- QAbstractEventDispatcher::EventFilter previousEventFilter;
-
mutable QMutex pollingMutex;
bool pollingRequired;