After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 137435 - Keyboard shortcut indicators in menus affects sort order
Keyboard shortcut indicators in menus affects sort order
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Low trivial
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-03-16 23:30 UTC by Kevin Cozens
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
possible patch to fix the sorting order (2.43 KB, patch)
2004-03-17 01:19 UTC, Simon Budig
none Details | Review
Slightly simplified version of patch to fix sorting of menu items. (1.70 KB, patch)
2004-03-17 04:44 UTC, Kevin Cozens
none Details | Review

Description Kevin Cozens 2004-03-16 23:30:52 UTC
I'm not sure if this is actually a GIMP or GTK+ bug. I'm using the latest
CVS copies of both GTK+ and GIMP.

The _ character in the strings used for a menu entry affect the ordering of
the items in the menu when the _ character appears at the start of the
string used for the menu item. To see this, look at the order of the items
in the Script-Fu/Logos menu. All of the menu items that have their first
character underlined are listed after the menu entries which do not have
their first character underlined.
Comment 1 Simon Budig 2004-03-17 00:38:07 UTC
This actually is Locale dependant, so strictly speaking it is not a
bug (set LC_COLLATE to a non-C non-POSIX locale and the menu items are
ordered correctly).

However, I am biased, since I explicitely set LC_COLLATE to C, to
avoid this very sorting for e.g. ls.

Not sure what to do about it. I'd prefer to strip the underscores from
the keys for the g_tree in plug_in_menus_create() to guarantee a
proper sorting order for POSIX environments.
Comment 2 Simon Budig 2004-03-17 01:19:03 UTC
Created attachment 25707 [details] [review]
possible patch to fix the sorting order
Comment 3 Kevin Cozens 2004-03-17 04:43:27 UTC
The patch fixes the problem. I simplified the patch slightly as you
will see below. The patch does a strdup on menupath. Does this need to
be g_free'ed after the call to g_tree_insert() or will the key be
freed later when the menu is removed?
Comment 4 Kevin Cozens 2004-03-17 04:44:40 UTC
Created attachment 25714 [details] [review]
Slightly simplified version of patch to fix sorting of menu items.
Comment 5 Simon Budig 2004-03-17 10:07:05 UTC
The key must be freed and thats the reason why my patch patched the
call to g_tree_new_full() (adding the function to free the key).
Comment 6 Michael Natterer 2004-03-17 11:41:08 UTC
Yea, Simon's patch is the correct one because it doesn't
leak the key. Please apply and use gimp_strip_uline()
from libgimpbase/gimputils.c
Comment 7 Simon Budig 2004-03-17 14:18:39 UTC
Fixed in CVS:

2004-03-17  Simon Budig  <simon@gimp.org>

        * app/gui/plug-in-menus.c: Sort the plugin menu entries with
        the mnemonics stripped. Avoids weird ordering in the "C" and
        "POSIX" locales.

        Fixes bug #137435.