> On Aug. 6, 2012, 6:26 a.m., Oswald Buddenhagen wrote:
> > kdm/backend/bootman.c, line 232
> > <http://git.reviewboard.kde.org/r/105563/diff/14/?file=76092#file76092line232>
> >
> >     can be inlined into the caller


> On Aug. 6, 2012, 6:26 a.m., Oswald Buddenhagen wrote:
> > ksmserver/shutdowndlg.cpp, line 488
> > <http://git.reviewboard.kde.org/r/105563/diff/14/?file=76096#file76096line488>
> >
> >     as you make assumptions about the list structure below anyway, you can 
> > just make the menus a stack (though then you need a condition to track when 
> > you need to pop items - but that's still shorter and more elegant than this 
> > findMenu stuff, i think).
> 
> Konstantinos Smanis wrote:
>     I could be wrong but how is this gonna work with nested submenus?
>     
>     submenu 'foo' {
>       menuentry 'bar' {
>       }
>       submenu 'baz' {
>         menuentry 'test' {
>         }
>       }
>       menuentry 'test2' {
>       }
>     }
>     
>     You pop once to get foo from the stack, add bar to foo, then pop baz and 
> foo is gone; where will test2 go?
> 
> Oswald Buddenhagen wrote:
>     eh? foo stays on the stack till the end.
>     
>     i think the algorithm is more or less like this:
>     
>     while not nested into current menu
>       pop current menu
>     # you already have the following part
>     if submenu
>       push current menu
>     else
>       add entry
>

Much more elegant, I would have never thought of this approach!


- Konstantinos


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105563/#review16926
-----------------------------------------------------------


On Aug. 6, 2012, 6:29 p.m., Konstantinos Smanis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105563/
> -----------------------------------------------------------
> 
> (Updated Aug. 6, 2012, 6:29 p.m.)
> 
> 
> Review request for KDE Runtime and Oswald Buddenhagen.
> 
> 
> Description
> -------
> 
> Recent versions of GRUB2 introduce submenus which allow for nesting levels to 
> appear (instead of the flat list in the past).
> This patch consists of two parts: the parsing part in KDM (bootman.c) and 
> creating a menu structure from the parsed list in ksmserver (shutdowndlg.*)
> The parsing part produces a list like this:
> 
> Gentoo GNU/Linux
> Advanced options for Gentoo GNU/Linux
> Advanced options for Gentoo GNU/Linux>Gentoo GNU/Linux, with Linux 3.4.4
> Advanced options for Gentoo GNU/Linux>Gentoo GNU/Linux, with Linux 3.4.4 
> (recovery mode)
> Windows 7 (loader) (on /dev/sda2)
> ???? ?????????
> 
> which is then converted into the menu structure. These full identifiers can 
> be properly used with `grub2-reboot`.
> 
> More info about submenus: http://ubuntuforums.org/showthread.php?p=10720316
> Also check the related bug.
> 
> The parsing part of the patch can be applied in the KDE/4.9 and master 
> branches as well (tested and working in KDE 4.8.95 and 4.9.x). ksmserver has 
> migrated to QML since then however, and the menu structure has to wait. 
> Currently it looks like this: http://i50.tinypic.com/96bw35.png
> Related ML-discussion: 
> http://lists.kde.org/?l=kde-core-devel&m=134160279511422&w=2
> Update: There is a proper fix now for KDE/4.9 and master: 
> https://git.reviewboard.kde.org/r/105568/
> 
> 
> This addresses bug 297209.
>     http://bugs.kde.org/show_bug.cgi?id=297209
> 
> 
> Diffs
> -----
> 
>   kdm/backend/bootman.c 8b834d2 
>   kdm/backend/ctrl.c 5d219fe 
>   kdm/backend/dm.h 13e7b45 
>   kdm/backend/util.c 6cd93ef 
>   ksmserver/shutdowndlg.cpp a09a1a7 
> 
> Diff: http://git.reviewboard.kde.org/r/105563/diff/
> 
> 
> Testing
> -------
> 
> Works with the menu file produced in my system with `grub2-mkconfig`.
> Also works with a custom menu file I made (as shown in the second screenshot).
> 
> 
> Screenshots
> -----------
> 
> Distribution's stock menu file
>   http://git.reviewboard.kde.org/r/105563/s/633/
> A custom menu file for testing
>   http://git.reviewboard.kde.org/r/105563/s/634/
> 
> 
> Thanks,
> 
> Konstantinos Smanis
> 
>

Reply via email to