From patchwork Mon Jun 29 09:35:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 11632655 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 668E8912 for ; Mon, 29 Jun 2020 21:37:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F3B0206E9 for ; Mon, 29 Jun 2020 21:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593466646; bh=wGa+qBV2V1GP8GCaDKNfsF9c/pokG/wFsofWOOaD/1A=; h=From:Cc:Subject:Date:In-Reply-To:References:To:List-ID:From; b=NCBdDLsdifl+YD496FiDj07I6l0VFWVH6KozYRLysV1p1rT21XYScg8U3+YhE4hib NUAI1hVvWLEH1c8AwjYC7hLQbCQlyL3By3ID8FBGAN7ewaFTd7Ky0Zqywj69V4xVlK 8MIgGNt41MOrGFpJqt0CKBWxCEVP3oCSUqZIU8JU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728409AbgF2VhQ (ORCPT ); Mon, 29 Jun 2020 17:37:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:60658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728406AbgF2Ski (ORCPT ); Mon, 29 Jun 2020 14:40:38 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D5D89233FA; Mon, 29 Jun 2020 09:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593423343; bh=wGa+qBV2V1GP8GCaDKNfsF9c/pokG/wFsofWOOaD/1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1d8+pOd8qlUbq9Lf6Tv9SgdKv325LXF70tWFmB1u1Oy/VYEknAoL1KTkyUaW524Wt NceffM3cUwmzpAomZGl0ISQwzj1hmI/Ow5CNDG+oY+juEoas4OQkRTcYw04Zr4w2Qn WnwzvL0VObe0zqRSLthfSjypbYDrwOkFeJsz49CU= Received: from mchehab by mail.kernel.org with local (Exim 4.93) (envelope-from ) id 1jpqCS-006cAF-Eg; Mon, 29 Jun 2020 11:35:40 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Maxim Levitsky , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] kconfig: qconf: cleanup includes Date: Mon, 29 Jun 2020 11:35:35 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The usage of c-like include is deprecated on modern Qt versions. Use the c++ style includes. While here, remove uneeded and redundant ones, sorting them on alphabetic order. Signed-off-by: Mauro Carvalho Chehab --- scripts/kconfig/qconf.cc | 27 +++++++++------------------ scripts/kconfig/qconf.h | 14 +++++++------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index c0ac8f7b5f1a..0e06afa08908 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -4,27 +4,18 @@ * Copyright (C) 2015 Boris Barbulovski */ -#include - -#include -#include -#include #include +#include +#include +#include #include +#include +#include +#include #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index c879d79ce817..d913a02967ae 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -3,17 +3,17 @@ * Copyright (C) 2002 Roman Zippel */ -#include -#include -#include +#include +#include #include -#include +#include +#include #include #include -#include #include -#include -#include +#include +#include + #include "expr.h" class ConfigView; From patchwork Mon Jun 29 09:35:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 11632641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF076138C for ; Mon, 29 Jun 2020 21:36:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8DA4206E9 for ; Mon, 29 Jun 2020 21:36:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593466582; bh=PB+3AQAalgU2HfA/Ow/B31cXbQPKTJ+EqjMYiPpBE6M=; h=From:Cc:Subject:Date:In-Reply-To:References:To:List-ID:From; b=jq5Zqtxmczy37DPhQB/lLYcd6C679j2IrQdh0DCYdT5l6evLFFCeo8UKsP5DblesG ngCfqLSShvyAw4sxb1x4fPut/MaOR1MQnHtM8UcwhhQjGGF+kuk+PO38PoBdoAdPWI xmC9wzzB6vbVs0De3Mfph7iBbE57DTxZFO0hkxKY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728468AbgF2VgO (ORCPT ); Mon, 29 Jun 2020 17:36:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:60598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728459AbgF2Skn (ORCPT ); Mon, 29 Jun 2020 14:40:43 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4AB1233F6; Mon, 29 Jun 2020 09:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593423343; bh=PB+3AQAalgU2HfA/Ow/B31cXbQPKTJ+EqjMYiPpBE6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V+fzcmZIz1xFsARlxvRksUz/DLcAnRUzzDClqT4BG/Zw2/3YuVGAjbfe3BQTORL4I T4fxISy+GjbYMETFO3K7KsnVqumbJK8spCNQntGO/57KUG5bCKu8b7kr2ScVo16vj3 wjA8BVPoiz6Bw3SDQT2fUqB61cbLCrQRlKj0KmWQ= Received: from mchehab by mail.kernel.org with local (Exim 4.93) (envelope-from ) id 1jpqCS-006cAJ-Fg; Mon, 29 Jun 2020 11:35:40 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Maxim Levitsky , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] kconfig: qconf: ensure that only one item will be highlighted Date: Mon, 29 Jun 2020 11:35:36 +0200 Message-Id: <9cc77cb28cf641d537b3dd08892f3d655f26ffb2.1593423060.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The logic which is used by search to show a new link lacks support for un-selecting a previously-selected item. Signed-off-by: Mauro Carvalho Chehab --- scripts/kconfig/qconf.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 0e06afa08908..67dac2406a98 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1662,6 +1662,13 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) } if (list) { + /* Clear an already-selected item */ + if (!list->selectedItems().isEmpty()) { + item = (ConfigItem*)list->selectedItems().first(); + if (item) + item->setSelected(false); + } + item = list->findConfigItem(menu); if (item) { item->setSelected(true); From patchwork Mon Jun 29 09:35:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 11632647 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD436912 for ; Mon, 29 Jun 2020 21:36:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B60082072D for ; Mon, 29 Jun 2020 21:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593466618; bh=VCjY49ferZsCCxqph3DjOC0Gs9TAo8BZtaFmbJ/4AOI=; h=From:Cc:Subject:Date:In-Reply-To:References:To:List-ID:From; b=tBbF1OYzTjOzf0YT3943pYBJ07PpO/PMtzlm0fi10CL3KCxN1nUTrOG3dqklwoTF1 3xvboe9nVJhJsLfSwWe0Y8BAi3KX8RYPCt1TmCnfgb25LT4KrIzizGvCXFj2V2FnSG SO3OfUPEB9phwpAr6bc3k71Lt39ASG8TSr1u9SuE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403836AbgF2Vg5 (ORCPT ); Mon, 29 Jun 2020 17:36:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:60646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728422AbgF2Skj (ORCPT ); Mon, 29 Jun 2020 14:40:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4B29233F8; Mon, 29 Jun 2020 09:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593423343; bh=VCjY49ferZsCCxqph3DjOC0Gs9TAo8BZtaFmbJ/4AOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qbqYiyFNA51rrCZeB53ddQFVfqqhdwpfKQ9aC58nXmDz2JG+8nSzYVQldrwZ1vnoc ORLWCcUOEYpt9U1FE/jn5wkQglaMDonXe+ZzGT3gyv31zRA0VRyLbyjm7i7vdQem2F Ub0mVJY11igHRbWJlyr0OsYES2mSVfZ+linnK3ZQ= Received: from mchehab by mail.kernel.org with local (Exim 4.93) (envelope-from ) id 1jpqCS-006cAN-GX; Mon, 29 Jun 2020 11:35:40 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Maxim Levitsky , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] kconfig: qconf: make search fully work again on split mode Date: Mon, 29 Jun 2020 11:35:37 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When the search dialog box finds symbols/menus that match the search criteria, it presents all results at the window. Clicking on a search result should make qconf to navigate to the selected item. This works on singleMode and on fullMode, but on splitMode, the navigation is broken. This was partially caused by an incomplete Qt5 conversion and by the followup patches that restored the original behavior. When qconf is on split mode, it has to update both the config and the menu views. Right now, such logic is broken, as it is not seeking using the right structures. On qconf, the screen is split into 3 parts: +------------+-------+ | | | | Config | Menu | | | | +------------+-------+ | | | ConfigInfo | | | +--------------------+ On singleMode and on fullMode, the menuView is hidden, and search updates only the configList (which controls the ConfigView). On SplitMode, the search logic should detect if the variable is a leaf or not. If it is a leaf, it should be presented at the menuView, and both configList and menuList should be updated. Otherwise, just the configList should be updated. Link: https://lore.kernel.org/lkml/a98b0f0ebe0c23615a76f1d23f25fd0c84835e6b.camel@redhat.com/ Reported-by: Maxim Levitsky Signed-off-by: Mauro Carvalho Chehab --- scripts/kconfig/qconf.cc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 67dac2406a98..85782da3e464 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1636,22 +1636,33 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) return; list->setRootMenu(parent); break; - case symbolMode: + case menuMode: if (menu->flags & MENU_ROOT) { - configList->setRootMenu(menu); + menuList->setRootMenu(menu); configList->clearSelection(); - list = menuList; - } else { list = configList; + } else { parent = menu_get_parent_menu(menu->parent); if (!parent) return; - item = menuList->findConfigItem(parent); + + /* Clear an already-selected item */ + if (!configList->selectedItems().isEmpty()) { + item = (ConfigItem*)configList->selectedItems().first(); + if (item) + item->setSelected(false); + } + + /* Select the config view */ + item = configList->findConfigItem(parent); if (item) { item->setSelected(true); - menuList->scrollToItem(item); + configList->scrollToItem(item); } - list->setRootMenu(parent); + + menuList->setRootMenu(parent); + menuList->clearSelection(); + list = menuList; } break; case fullMode: From patchwork Mon Jun 29 09:35:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 11632645 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CBA2138C for ; Mon, 29 Jun 2020 21:36:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F0F92072D for ; Mon, 29 Jun 2020 21:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593466598; bh=uaEYaj64jJNvDMfBvwTCam7FOAO6+8uqFEsZk/mX7tc=; h=From:Cc:Subject:Date:In-Reply-To:References:To:List-ID:From; b=par0n6vx51PNPlgpPDq3gpzdU9o0ySc2XqJRKtOrulKRhBiPjLs/rl8/bcNXJvPGZ cPqGo77jH5mR8eClG064bkq2/XUjTjrHrOmRnHHOBp51HFR2QTt5Qlwn7ouYPPwRFl Z0axFdXRp2Nyno/YUK++d2UJoA5IKf6p0PiGIRFw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729328AbgF2Vg2 (ORCPT ); Mon, 29 Jun 2020 17:36:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:60666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728439AbgF2Skl (ORCPT ); Mon, 29 Jun 2020 14:40:41 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D46AF2313F; Mon, 29 Jun 2020 09:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593423343; bh=uaEYaj64jJNvDMfBvwTCam7FOAO6+8uqFEsZk/mX7tc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zqGYu0UYDuk58ikGtJ5IfdWKoANHEk1LWsm4Ie3+le/uhaQINtoodnukq8+q1amjb y7dqCpOd9f+BrjfaRMA6tz8wLhvIyn8XWqc4Kt+k/nfw3xjT+yqJdQhpn94QF9Xgeq 2ok+eg2uw5IfeZGSwtrfw89pexoKFHoF9m8+iJmc= Received: from mchehab by mail.kernel.org with local (Exim 4.93) (envelope-from ) id 1jpqCS-006cAR-IK; Mon, 29 Jun 2020 11:35:40 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Maxim Levitsky , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] kconfig: qconf: make debug links work again Date: Mon, 29 Jun 2020 11:35:38 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The Qt5 conversion broke support for debug info links. Restore the behaviour added by changeset ab45d190fd4a ("kconfig: create links in info window"). The original approach were to pass a pointer for a data struct via an . That doesn't sound a good idea, as, if something gets wrong, the app could crash. So, instead, pass the name of the symbol, and validate such symbol at the hyperlink handling logic. Link: https://lore.kernel.org/lkml/20200628125421.12458086@coco.lan/ Reported-by: Maxim Levitsky Signed-off-by: Mauro Carvalho Chehab --- scripts/kconfig/qconf.cc | 75 +++++++++++++++++++++++++++++++++++++--- scripts/kconfig/qconf.h | 1 + 2 files changed, 71 insertions(+), 5 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 85782da3e464..49f0688fceb8 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -1012,7 +1013,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) : Parent(parent), sym(0), _menu(0) { setObjectName(name); - + setOpenLinks(false); if (!objectName().isEmpty()) { configSettings->beginGroup(objectName()); @@ -1085,7 +1086,7 @@ void ConfigInfoView::menuInfo(void) if (sym->name) { head += " ("; if (showDebug()) - head += QString().sprintf("", sym); + head += QString().sprintf("", sym->name); head += print_filter(sym->name); if (showDebug()) head += ""; @@ -1094,7 +1095,7 @@ void ConfigInfoView::menuInfo(void) } else if (sym->name) { head += ""; if (showDebug()) - head += QString().sprintf("", sym); + head += QString().sprintf("", sym->name); head += print_filter(sym->name); if (showDebug()) head += ""; @@ -1145,7 +1146,7 @@ QString ConfigInfoView::debug_info(struct symbol *sym) switch (prop->type) { case P_PROMPT: case P_MENU: - debug += QString().sprintf("prompt: ", prop->menu); + debug += QString().sprintf("prompt: ", sym->name); debug += print_filter(prop->text); debug += "
"; break; @@ -1217,13 +1218,74 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char QString str2 = print_filter(str); if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) { - *text += QString().sprintf("", sym); + *text += QString().sprintf("", sym->name); *text += str2; *text += ""; } else *text += str2; } +void ConfigInfoView::clicked(const QUrl &url) +{ + QByteArray str = url.toEncoded(); + const std::size_t count = str.size(); + char *data = new char[count + 1]; + struct symbol **result; + struct menu *m = NULL; + char type; + + if (count < 1) { + qInfo() << "Clicked link is empty"; + delete data; + return; + } + + memcpy(data, str.constData(), count); + data[count] = '\0'; + type = data[0]; + + /* Seek for exact match */ + data[0] = '^'; + strcat(data, "$"); + result = sym_re_search(data); + if (!result) { + qInfo() << "Clicked symbol is invalid:" << data; + delete data; + return; + } + + sym = *result; + if (type == 's') { + symbolInfo(); + emit showDebugChanged(true); + free(result); + delete data; + return; + } + + /* URL is a menu */ + for (struct property *prop = sym->prop; prop; prop = prop->next) { + if (prop->type != P_PROMPT && prop->type != P_MENU) + continue; + m = prop->menu; + break; + } + + if (!m) { + qInfo() << "Clicked menu is invalid:" << data; + free(result); + delete data; + return; + } + + _menu = m; + menuInfo(); + + emit showDebugChanged(true); + free(result); + delete data; +} + QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos) { QMenu* popup = Parent::createStandardContextMenu(pos); @@ -1497,6 +1559,9 @@ ConfigMainWindow::ConfigMainWindow(void) helpMenu->addAction(showIntroAction); helpMenu->addAction(showAboutAction); + connect (helpText, SIGNAL (anchorClicked (const QUrl &)), + helpText, SLOT (clicked (const QUrl &)) ); + connect(configList, SIGNAL(menuChanged(struct menu *)), helpText, SLOT(setInfo(struct menu *))); connect(configList, SIGNAL(menuSelected(struct menu *)), diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index d913a02967ae..a193137f2314 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -250,6 +250,7 @@ public slots: void setInfo(struct menu *menu); void saveSettings(void); void setShowDebug(bool); + void clicked (const QUrl &url); signals: void showDebugChanged(bool); From patchwork Mon Jun 29 09:35:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 11632651 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C753313BD for ; Mon, 29 Jun 2020 21:37:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A506E206E9 for ; Mon, 29 Jun 2020 21:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593466627; bh=JxS7qG1TBN6E09S+KrZbuW/QoJaZC8vZAevnWONK0Vo=; h=From:Cc:Subject:Date:In-Reply-To:References:To:List-ID:From; b=MhWqcqMgo8f7YU6EVipc8O6Et5tXOdVWyNrFYwGQ4trSBU6TApd0EAPc3yzRraevu MachHEhU4DVTo1LKSswmqsZ4zqOh+Ufd+H2qJ57EPsyv40L4MAr13tY4ocNchLxx3f HHYQMN584waIKNBrRtXgCPHYM0tv+h2fLQPK+7sc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728663AbgF2VhG (ORCPT ); Mon, 29 Jun 2020 17:37:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:60596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728425AbgF2Skj (ORCPT ); Mon, 29 Jun 2020 14:40:39 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D543F233F9; Mon, 29 Jun 2020 09:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593423343; bh=JxS7qG1TBN6E09S+KrZbuW/QoJaZC8vZAevnWONK0Vo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yap008obp4KXXBTi7vzlQ84ybSpi0OZY1NOtylkU/7C4HW0pvvZ8SNDpKlW3/DYzu p6unDyDIPAtgfVloBtlGC2t1HarckC+bgB1MNZiDt6rkPEKR1uiDcd3iYuHZLCZPS1 745yr1hXLGK2ih1KsHSEd2AhJRSF9ENhLhBX4Dc4= Received: from mchehab by mail.kernel.org with local (Exim 4.93) (envelope-from ) id 1jpqCS-006cAV-Jc; Mon, 29 Jun 2020 11:35:40 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Maxim Levitsky , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] kconfig: qconf: navigate menus on hyperlinks Date: Mon, 29 Jun 2020 11:35:39 +0200 Message-Id: <45fa5ad583de1766de6169366df1df5837c5dc7c.1593423060.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Instead of just changing the helper window to show a dependency, also navigate to it at the config and menu widgets. Signed-off-by: Mauro Carvalho Chehab --- scripts/kconfig/qconf.cc | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 49f0688fceb8..d8870b15a178 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1232,7 +1232,6 @@ void ConfigInfoView::clicked(const QUrl &url) char *data = new char[count + 1]; struct symbol **result; struct menu *m = NULL; - char type; if (count < 1) { qInfo() << "Clicked link is empty"; @@ -1242,7 +1241,6 @@ void ConfigInfoView::clicked(const QUrl &url) memcpy(data, str.constData(), count); data[count] = '\0'; - type = data[0]; /* Seek for exact match */ data[0] = '^'; @@ -1255,15 +1253,8 @@ void ConfigInfoView::clicked(const QUrl &url) } sym = *result; - if (type == 's') { - symbolInfo(); - emit showDebugChanged(true); - free(result); - delete data; - return; - } - /* URL is a menu */ + /* Seek for the menu which holds the symbol */ for (struct property *prop = sym->prop; prop; prop = prop->next) { if (prop->type != P_PROMPT && prop->type != P_MENU) continue; @@ -1271,17 +1262,11 @@ void ConfigInfoView::clicked(const QUrl &url) break; } - if (!m) { + if (!m) qInfo() << "Clicked menu is invalid:" << data; - free(result); - delete data; - return; - } + else + emit menuSelected(m); - _menu = m; - menuInfo(); - - emit showDebugChanged(true); free(result); delete data; } @@ -1750,6 +1735,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) item->setSelected(true); list->scrollToItem(item); list->setFocus(); + helpText->setInfo(menu); } } }