diff mbox series

kconfig: qconf: Fix find on split mode

Message ID 371f4815f6daac50e90057520d5f2b40a6ca3a74.1593096720.git.mchehab+huawei@kernel.org (mailing list archive)
State New, archived
Headers show
Series kconfig: qconf: Fix find on split mode | expand

Commit Message

Mauro Carvalho Chehab June 25, 2020, 2:52 p.m. UTC
The logic handling find on split mode is currently broken.
Fix it, making it work again as expected.

Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 scripts/kconfig/qconf.cc | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

Comments

Masahiro Yamada June 28, 2020, 2:17 a.m. UTC | #1
On Thu, Jun 25, 2020 at 11:53 PM Mauro Carvalho Chehab
<mchehab+huawei@kernel.org> wrote:
>
> The logic handling find on split mode is currently broken.
> Fix it, making it work again as expected.
>
> Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---


Applied to linux-kbuild.
Thanks.


>  scripts/kconfig/qconf.cc | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index c0ac8f7b5f1a..b8f577c6e8aa 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -1645,22 +1645,21 @@ 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 {
> +                       configList->setRootMenu(menu);
> +                       configList->clearSelection();
> +
>                         parent = menu_get_parent_menu(menu->parent);
>                         if (!parent)
>                                 return;
> -                       item = menuList->findConfigItem(parent);
> -                       if (item) {
> -                               item->setSelected(true);
> -                               menuList->scrollToItem(item);
> -                       }
> -                       list->setRootMenu(parent);
> +                       menuList->setRootMenu(parent);
> +
> +                       list = menuList;
>                 }
>                 break;
>         case fullMode:
> --
> 2.26.2
>
>
Maxim Levitsky June 28, 2020, 8:40 a.m. UTC | #2
On Thu, 2020-06-25 at 16:52 +0200, Mauro Carvalho Chehab wrote:
> The logic handling find on split mode is currently broken.
> Fix it, making it work again as expected.

I tested this patch and it works well.
There is one really small cosmetic issue:

If you select search result, and then select another search result
which happens not to update the 'menu', then both the results are
selected (that is the old one doesn't clear its selection)

Best regards,
	Maxim Levitsky

> 
> Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  scripts/kconfig/qconf.cc | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index c0ac8f7b5f1a..b8f577c6e8aa 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -1645,22 +1645,21 @@ 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 {
> +			configList->setRootMenu(menu);
> +			configList->clearSelection();
> +
>  			parent = menu_get_parent_menu(menu->parent);
>  			if (!parent)
>  				return;
> -			item = menuList->findConfigItem(parent);
> -			if (item) {
> -				item->setSelected(true);
> -				menuList->scrollToItem(item);
> -			}
> -			list->setRootMenu(parent);
> +			menuList->setRootMenu(parent);
> +
> +			list = menuList;
>  		}
>  		break;
>  	case fullMode:
Masahiro Yamada June 28, 2020, 2:42 p.m. UTC | #3
On Sun, Jun 28, 2020 at 5:40 PM Maxim Levitsky <mlevitsk@redhat.com> wrote:
>
> On Thu, 2020-06-25 at 16:52 +0200, Mauro Carvalho Chehab wrote:
> > The logic handling find on split mode is currently broken.
> > Fix it, making it work again as expected.
>
> I tested this patch and it works well.
> There is one really small cosmetic issue:
>
> If you select search result, and then select another search result
> which happens not to update the 'menu', then both the results are
> selected (that is the old one doesn't clear its selection)

I see this too.
So, this can be improved somehow...



>
> Best regards,
>         Maxim Levitsky
>
> >
> > Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> > ---
> >  scripts/kconfig/qconf.cc | 19 +++++++++----------
> >  1 file changed, 9 insertions(+), 10 deletions(-)
> >
> > diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> > index c0ac8f7b5f1a..b8f577c6e8aa 100644
> > --- a/scripts/kconfig/qconf.cc
> > +++ b/scripts/kconfig/qconf.cc
> > @@ -1645,22 +1645,21 @@ 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 {
> > +                     configList->setRootMenu(menu);
> > +                     configList->clearSelection();
> > +
> >                       parent = menu_get_parent_menu(menu->parent);
> >                       if (!parent)
> >                               return;
> > -                     item = menuList->findConfigItem(parent);
> > -                     if (item) {
> > -                             item->setSelected(true);
> > -                             menuList->scrollToItem(item);
> > -                     }
> > -                     list->setRootMenu(parent);
> > +                     menuList->setRootMenu(parent);
> > +
> > +                     list = menuList;
> >               }
> >               break;
> >       case fullMode:
>
>
Masahiro Yamada June 30, 2020, 3:53 a.m. UTC | #4
On Sun, Jun 28, 2020 at 11:42 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Sun, Jun 28, 2020 at 5:40 PM Maxim Levitsky <mlevitsk@redhat.com> wrote:
> >
> > On Thu, 2020-06-25 at 16:52 +0200, Mauro Carvalho Chehab wrote:
> > > The logic handling find on split mode is currently broken.
> > > Fix it, making it work again as expected.
> >
> > I tested this patch and it works well.
> > There is one really small cosmetic issue:
> >
> > If you select search result, and then select another search result
> > which happens not to update the 'menu', then both the results are
> > selected (that is the old one doesn't clear its selection)
>
> I see this too.
> So, this can be improved somehow...



I dropped this one
because it was superseded by the new version.
diff mbox series

Patch

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index c0ac8f7b5f1a..b8f577c6e8aa 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1645,22 +1645,21 @@  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 {
+			configList->setRootMenu(menu);
+			configList->clearSelection();
+
 			parent = menu_get_parent_menu(menu->parent);
 			if (!parent)
 				return;
-			item = menuList->findConfigItem(parent);
-			if (item) {
-				item->setSelected(true);
-				menuList->scrollToItem(item);
-			}
-			list->setRootMenu(parent);
+			menuList->setRootMenu(parent);
+
+			list = menuList;
 		}
 		break;
 	case fullMode: