summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/okeyconfigmanager.cpp12
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
@@ -484,48 +484,51 @@ OKeyConfigManager::OKeyConfigManager( Opie::Core::OConfig* conf,
if ( m_grab )
QPEApplication::grabKeyboard();
m_event_mask = OKeyConfigManager::MaskReleased;
}
/**
* Destructor
*/
OKeyConfigManager::~OKeyConfigManager() {
if ( m_grab )
QPEApplication::ungrabKeyboard();
+ delete m_map;
}
/**
* Load the Configuration from the OConfig
* If a Key is restricted but was in the config we will
* make it be the empty key paur
* We will change the group but restore to the previous.
*
* @see OKeyPair::emptyKey
*/
void OKeyConfigManager::load() {
Opie::Core::OConfigGroupSaver( m_conf, m_group );
/*
* Read each item
*/
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() );
}
delete m_map; m_map = 0;
}
/**
* We will save the current configuration
* to the OConfig. We will change the group but restore
* to the previous
*/
void OKeyConfigManager::save() {
@@ -676,24 +679,27 @@ OKeyPair::List OKeyConfigManager::blackList()const {
*/
void OKeyConfigManager::handleWidget( QWidget* wid ) {
wid->installEventFilter( this );
}
/**
* @internal
*/
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;
QKeyEvent *key = static_cast<QKeyEvent*>( ev );
OKeyConfigItem item = handleKeyEvent( key );
if ( item.isEmpty() )
return false;
QWidget *wid = static_cast<QWidget*>( obj );