forked from qt-creator/qt-creator
ProjectExplorer: Let the user delete sessions via the "Delete" key
Task-number: QTCREATORBUG-17668 Change-Id: Id827be147627a54953e6495be503c97b31232cf3 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -141,5 +141,16 @@ void SessionView::showEvent(QShowEvent *event)
|
||||
setFocus();
|
||||
}
|
||||
|
||||
void SessionView::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() != Qt::Key_Delete) {
|
||||
TreeView::keyPressEvent(event);
|
||||
return;
|
||||
}
|
||||
const QString session = currentSession();
|
||||
if (!session.isEmpty() && session != "default" && session != SessionManager::activeSession())
|
||||
deleteCurrentSession();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
Reference in New Issue
Block a user