! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
use GenericName where appropriate
Status:
RESOLVED: FIXED
Product:
Libxfce4menu
Component:
General

Comments

Description Brian J. Tarricone (not reading bugmail) 2007-12-13 10:45:57 CET
Desktop files that have "OnlyShowIn=XFCE;" should use the GenericName= field in place of Name= if GenericName= is present.  This cleans up the Settings menu ("Xfce 4 Blah Settings" -> "Blah Settings") for a lot of stuff.

For the case where there's a Name[xx]= line for the current locale, but no corresponding GenericName[xx]= line, Name[xx]= should be used.

I'm also leaning toward showing GenericName for desktop files that have X-XFCE in Categories as well, but I'm not sure about that.  At minimum, the first two paragraphs should be implemented.

Alternately, if you don't want to 'force' a choice, at least provide an accessor for GenericName, and perhaps convenience API, e.g.:

gboolean xfce_menu_item_has_category(XfceMenuItem *, const gchar *);

... to test whether or not an XfceMenuItem has a particular category (so I can be lazy and not have to use _get_categories()).
Comment 1 Jannis Pohlmann editbugs 2007-12-13 17:00:49 CET
You're right, I don't like to force a certain behaviour unless it follows the menu  standard. But of course I'm fine with adding _get_generic_name() and _has_category() methods. 
Comment 2 Brian J. Tarricone (not reading bugmail) 2007-12-13 18:19:21 CET
Is there some way to tell about localisation?  As I said, I'd like it to prefer a translated Name= over an untranslated GenericName=, though I suppose that's not critical (you could consider it an incomplete translation bug in the app providing the desktop file).  I guess I'd be fine taking the lazy way out and punting this back to the app author.
Comment 3 Jannis Pohlmann editbugs 2007-12-22 23:50:51 CET
Revision 26500:

* libxfce4menu/xfce-menu-item.{c,h}: Add support for "GenericName" as
  requested by Brian. Also add a convenience function 
  xfce_menu_item_has_category (XfceMenuItem *, const char *).
Comment 4 Jannis Pohlmann editbugs 2007-12-22 23:52:14 CET
And yeah, if translations are missing, just blame the author of the .desktop file. libxfce4menu uses XfceRc which handles i18n internally. Working around missing translations just messes things up.
Comment 5 Brian J. Tarricone (not reading bugmail) 2008-01-02 00:40:13 CET
Hmm, one more thing.  I'd like to use GenericName if _has_category("X-XFCE"), or if OnlyShowIn=XFCE;.  Right now I can't tell if the OnlyShowIn key is actually present.  Any thoughts?
Comment 6 Jannis Pohlmann editbugs 2008-08-31 18:56:26 CEST
I've committed a new function to libxfce4menu in revision 27630. This might be exactly what you need:

        * libxfce4menu/xfce-menu-item.{c,h}: Add
          xfce_menu_item_only_show_in_environment() function which checks
          whether the current environment is present in the OnlyShowIn key of
          a menu item. This should close bug #3741.
Comment 7 Jannis Pohlmann editbugs 2008-10-31 17:15:55 CET
Is this one still valid, now that we only use Name= in the settings desktop entries?
Comment 8 Brian J. Tarricone (not reading bugmail) 2008-10-31 18:04:47 CET
Well it's fixed regardless...  I'd still like to see the sorting issue fixed, tho.

Bug #3741

Reported by:
Brian J. Tarricone (not reading bugmail)
Reported on: 2007-12-13
Last modified on: 2009-07-14

People

Assignee:
Jannis Pohlmann
CC List:
0 users

Version

Attachments

Additional information