author | zecke <zecke> | 2004-08-14 17:15:44 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-14 17:15:44 (UTC) |
commit | 74363a9e1d5688d65286e7fea156227b68a28002 (patch) (unidiff) | |
tree | 3926a1a3bd42bebb2f67b3334735bc3b3931f796 /development | |
parent | 7657b6986a600ec1b3626c83e8f19036bf69e493 (diff) | |
download | opie-74363a9e1d5688d65286e7fea156227b68a28002.zip opie-74363a9e1d5688d65286e7fea156227b68a28002.tar.gz opie-74363a9e1d5688d65286e7fea156227b68a28002.tar.bz2 |
-Remove the KeyFilter on destruction
Alwin could we either add a 'QObject' as a owner so that we could use
QGuardedPtr or look for the deleteEvent ourselves.
Or let us create a KeyFilter ourselves that auto registers (maybe) but
cleans up itself in any case?
-rw-r--r-- | development/keyview/keyboardimpl.cpp | 4 | ||||
-rw-r--r-- | development/keyview/keyview.cpp | 7 | ||||
-rw-r--r-- | development/keyview/keyview.h | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/development/keyview/keyboardimpl.cpp b/development/keyview/keyboardimpl.cpp index 673eaa5..0216110 100644 --- a/development/keyview/keyboardimpl.cpp +++ b/development/keyview/keyboardimpl.cpp | |||
@@ -166,2 +166,4 @@ void KeyboardImpl::onKeyPress( QObject *receiver, const char *slot ) | |||
166 | { | 166 | { |
167 | Q_UNUSED( receiver ); | ||
168 | Q_CONST_UNUSED( slot ); | ||
167 | //if ( input ) | 169 | //if ( input ) |
@@ -178,2 +180,4 @@ QRESULT KeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **ifa | |||
178 | *iface = this; | 180 | *iface = this; |
181 | else | ||
182 | return QS_FALSE; | ||
179 | 183 | ||
diff --git a/development/keyview/keyview.cpp b/development/keyview/keyview.cpp index 8187744..cf082a8 100644 --- a/development/keyview/keyview.cpp +++ b/development/keyview/keyview.cpp | |||
@@ -67,2 +67,7 @@ KeyFilter::KeyFilter(QObject * parent, const char *name) : QObject( parent, name | |||
67 | 67 | ||
68 | KeyFilter::~KeyFilter() { | ||
69 | /* we need to remove the KeyFilter */ | ||
70 | Opie::Core::OKeyFilter::inst()->remHandler( this ); | ||
71 | } | ||
72 | |||
68 | bool KeyFilter::filter(int unicode, int keycode, int modifiers, bool isPress, | 73 | bool KeyFilter::filter(int unicode, int keycode, int modifiers, bool isPress, |
@@ -71,3 +76,3 @@ bool KeyFilter::filter(int unicode, int keycode, int modifiers, bool isPress, | |||
71 | qDebug( "unicode: %d, keycode: %d, modifiers: %0x, isPress: %d, autoRepeat: %d", | 76 | qDebug( "unicode: %d, keycode: %d, modifiers: %0x, isPress: %d, autoRepeat: %d", |
72 | unicode, keycode, modifiers, isPress ); | 77 | unicode, keycode, modifiers, isPress, autoRepeat ); |
73 | emit keyPressed(unicode, keycode, modifiers, isPress, autoRepeat); | 78 | emit keyPressed(unicode, keycode, modifiers, isPress, autoRepeat); |
diff --git a/development/keyview/keyview.h b/development/keyview/keyview.h index 5f1e943..87c0d15 100644 --- a/development/keyview/keyview.h +++ b/development/keyview/keyview.h | |||
@@ -25,3 +25,2 @@ private: | |||
25 | QLineEdit *autoRepeat; | 25 | QLineEdit *autoRepeat; |
26 | |||
27 | }; | 26 | }; |
@@ -34,2 +33,3 @@ public: | |||
34 | KeyFilter( QObject* parent, const char* name = 0); | 33 | KeyFilter( QObject* parent, const char* name = 0); |
34 | virtual ~KeyFilter(); | ||
35 | virtual bool filter(int unicode, int keycode, int modifiers, bool isPress, | 35 | virtual bool filter(int unicode, int keycode, int modifiers, bool isPress, |