aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/hotkey/hotkeymanager_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/General/hotkey/hotkeymanager_x11.cpp')
-rw-r--r--src/plugins/General/hotkey/hotkeymanager_x11.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/General/hotkey/hotkeymanager_x11.cpp b/src/plugins/General/hotkey/hotkeymanager_x11.cpp
index 0e1fab263..4775102df 100644
--- a/src/plugins/General/hotkey/hotkeymanager_x11.cpp
+++ b/src/plugins/General/hotkey/hotkeymanager_x11.cpp
@@ -112,15 +112,14 @@ HotkeyManager::HotkeyManager(QObject *parent) : QObject(parent)
HotkeyManager::~HotkeyManager()
{
- if(qApp && qApp->eventDispatcher())
- qApp->removeNativeEventFilter(this);
- foreach(Hotkey *key, m_grabbedKeys)
+ qApp->removeNativeEventFilter(this);
+ while(!m_grabbedKeys.isEmpty())
{
+ Hotkey *key = m_grabbedKeys.takeFirst ();
if(key->code)
XUngrabKey(QX11Info::display(), key->code, key->mod, QX11Info::appRootWindow());
+ delete key;
}
- while (!m_grabbedKeys.isEmpty())
- delete m_grabbedKeys.takeFirst ();
}
const QString HotkeyManager::getKeyString(quint32 key, quint32 modifiers)
@@ -200,9 +199,7 @@ bool HotkeyManager::nativeEventFilter(const QByteArray &eventType, void *message
case Hotkey::VOLUME_MUTE:
SoundCore::instance()->setMuted(!SoundCore::instance()->isMuted());
break;
-
}
-
}
}
return false;