Don't use QKeySequence::Delete to detect delete key event for play queue, instead check for no modifiers and the Delete key itself. Closing a terminal with Ctrl-D seems to cause Cantata to see QKeySequence::Delete

BUG: 377
This commit is contained in:
craig.p.drummond
2014-01-05 22:41:07 +00:00
committed by craig.p.drummond
parent 452e0c77fe
commit 20cc2bec8c
2 changed files with 9 additions and 2 deletions

View File

@@ -34,6 +34,9 @@
max_output_buffer_size setting.
18. Add CMake option to disable streams, dynamic, and online services. Refer to
INSTALL file for details.
19. Don't use QKeySequence::Delete to detect delete key event for play queue,
instead check for no modifiers and the Delete key itself. Closing a
terminal with Ctrl-D seems to cause Cantata to see QKeySequence::Delete
1.2.2
-----

View File

@@ -142,8 +142,12 @@ enum Tabs
bool DeleteKeyEventHandler::eventFilter(QObject *obj, QEvent *event)
{
if (view->hasFocus() && QEvent::KeyRelease==event->type() && static_cast<QKeyEvent *>(event)->matches(QKeySequence::Delete)) {
act->trigger();
if (view->hasFocus() && QEvent::KeyRelease==event->type()) {
QKeyEvent *keyEvent=static_cast<QKeyEvent *>(event);
if (Qt::NoModifier==keyEvent->modifiers() && Qt::Key_Delete==keyEvent->key()) {
act->trigger();
}
return true;
}
return QObject::eventFilter(obj, event);