author | zecke <zecke> | 2004-05-01 18:08:46 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-05-01 18:08:46 (UTC) |
commit | ec6a887d8abddbab085a0a3aecae5760ff85dbe8 (patch) (side-by-side diff) | |
tree | 93f42bc5ebc3a5428dc93af6b7b90392085a551f /libopie2/opiecore | |
parent | 8dd2d693000c916346f0bb7d94cbc02b8456c65b (diff) | |
download | opie-ec6a887d8abddbab085a0a3aecae5760ff85dbe8.zip opie-ec6a887d8abddbab085a0a3aecae5760ff85dbe8.tar.gz opie-ec6a887d8abddbab085a0a3aecae5760ff85dbe8.tar.bz2 |
Make the code more appealing to me
Fix small memory leak for the blacklist QMap
-rw-r--r-- | libopie2/opiecore/okeyconfigmanager.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libopie2/opiecore/okeyconfigmanager.cpp b/libopie2/opiecore/okeyconfigmanager.cpp index 18740ef..ad0f7f7 100644 --- a/libopie2/opiecore/okeyconfigmanager.cpp +++ b/libopie2/opiecore/okeyconfigmanager.cpp @@ -493,6 +493,7 @@ OKeyConfigManager::OKeyConfigManager( Opie::Core::OConfig* conf, OKeyConfigManager::~OKeyConfigManager() { if ( m_grab ) QPEApplication::ungrabKeyboard(); + delete m_map; } /** @@ -511,12 +512,14 @@ void OKeyConfigManager::load() { */ int key, mod; for( OKeyConfigItem::List::Iterator it = m_keys.begin(); it != m_keys.end(); ++it ) { - key = m_conf->readNumEntry( (*it).configKey()+"key", (*it).defaultKeyPair().keycode() ); - mod = m_conf->readNumEntry( (*it).configKey()+"mod", (*it).defaultKeyPair().modifier() ); + key = m_conf->readNumEntry( (*it).configKey()+"key", + (*it).defaultKeyPair().keycode() ); + mod = m_conf->readNumEntry( (*it).configKey()+"mod", + (*it).defaultKeyPair().modifier() ); OKeyPair okey( key, mod ); if ( !m_blackKeys.contains( okey ) && key != -1 && mod != -1 ) - (*it).setKeyPair( OKeyPair(key, mod) ); + (*it).setKeyPair( okey ); else (*it).setKeyPair( OKeyPair::emptyKey() ); } @@ -685,6 +688,9 @@ bool OKeyConfigManager::eventFilter( QObject* obj, QEvent* ev) { if ( !obj->isWidgetType() ) return false; + /* + * check if we care for the event + */ if ( (ev->type() != QEvent::KeyPress||!testEventMask(MaskPressed)) && (ev->type() != QEvent::KeyRelease||!testEventMask(MaskReleased)) ) return false; |