]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kconfig: qconf: avoid unnecessary parentSelected() when ESC is pressed
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 23 Oct 2024 18:17:58 +0000 (03:17 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Tue, 5 Nov 2024 23:46:34 +0000 (08:46 +0900)
When the ESC key is pressed, the parentSelected() signal is currently
emitted for singleMode, menuMode, and symbolMode.

However, parentSelected() signal is functional only for singleMode.

In menuMode, the signal is connected to the goBack() slot, but nothing
occurs because configList->rootEntry is always &rootmenu.

In symbolMode (in the right pane), the parentSelected() signal is not
connected to any slot.

This commit prevents the unnecessary emission of the parentSelected()
signal.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/qconf.cc

index 5b1237bf085a5f908ae50e659fc7968b00e0e9ec..1948cda048d2746bbd5d753746239c423063b1ec 100644 (file)
@@ -724,7 +724,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
        struct menu *menu;
        enum prop_type type;
 
-       if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
+       if (ev->key() == Qt::Key_Escape && mode == singleMode) {
                emit parentSelected();
                ev->accept();
                return;