Summary: | [PATCH] validate.c: require all possible main categories to be present at once | ||
---|---|---|---|
Product: | desktop-file-utils | Reporter: | Igor Vlasenko <viy> |
Component: | general | Assignee: | Vincent Untz <vuntz> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | cwickert, kensington, ulm |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
validate.c: do not require all possible main categories to be present
second version (w/o Science) TextTools; should require either Office; or Utility;. no-main-category.patch no-main-category.patch related-categories.patch |
Description
Igor Vlasenko
2011-03-31 11:46:21 UTC
Created attachment 46910 [details] [review] second version (w/o Science) First patch contained a bug about Science (Science is not a main Category) so the proposed path is now for "Email", "Music", and "ProjectManagement" only. Created attachment 46914 [details] [review] TextTools; should require either Office; or Utility;. on a related note, "Dictionary" requires TextTools;Office; but not TextTools;Utility. but TextTools; requires Utility. to resolve this, TextTools; should require either Office; or Utility;. Comment on attachment 46910 [details] [review] second version (w/o Science) Review of attachment 46910 [details] [review]: ----------------------------------------------------------------- My understanding of the related categories in the spec is that "Office;TextTools" is different from "Office or TextTools". That's why it's implemented this way. Now, the spec might be using ";" where "or" should be used, and we should fix that first. The Music example is a good one where it sounds wrong. (In reply to comment #2) > Created attachment 46914 [details] [review] [review] > TextTools; should require either Office; or Utility;. > > on a related note, "Dictionary" requires TextTools;Office; > but not TextTools;Utility. > > but TextTools; requires Utility. > to resolve this, TextTools; should require either Office; or Utility;. Let's fix the spec first :-) (In reply to comment #4) > Let's fix the spec first :-) Completely agree. Yet I'm a novice here at freedesktop.org, I do not know where to ask about the spec changes :( Could you give me some directions? Another example where desktop-file-validate outputs a false positive is the desktop entry of GNU Emacs 24.1 which has "Development;TextEditor;" as categories. $ desktop-file-validate emacs.desktop emacs.desktop: error: (will be fatal in the future): value "TextEditor" in key "Categories" in group "Desktop Entry" requires another category to be present among the following categories: Utility The description of "Utility" is "Small utility application, 'Accessories'" which doesn't look right for Emacs. The spec actuall says: "The Related Categories column lists one or more categories that are *suggested* to be used in conjunction with the Additional Category." Suggested doesn't mean required. What's required to get this moving? Happy to help. (In reply to comment #6) > The spec actuall says: "The Related Categories column lists one or more > categories that are *suggested* to be used in conjunction with the Additional > Category." Suggested doesn't mean required. Yes, that's something we fixed recently in the spec, and that we need to handle in desktop-file-utils. I think we'll still have a warning if a main category is not present, as there's no guarantee the desktop file will appear where it should in the menus. A warning is no error, so I guess that'd be fine. Created attachment 67042 [details] [review] no-main-category.patch Here's a small patch that drops "does not contain a registered main category" errors, as per the updated spec. Created attachment 67044 [details] [review] no-main-category.patch Updated patch to turn lack of main category into a warning, wrt comment #8. Created attachment 67054 [details] [review] related-categories.patch This additional patch drops related category validation (since they are now optional), while retaining validation of "Category1;Category2" (compare with "Category1 or Category 2). Thanks for your patches, Michael. I've pushed some that are similar, but a bit different: - for the first one, we output a hint instead of a warning (hints are new, so nothing you could do) - for the second one, there are actually still cases where a category requires another (Audio requires AudioVideo). So this had to work another way; I added some hint for the related categories, also. Keeping the bug open for the initial comment (see my comment 3). (In reply to comment #12) > Keeping the bug open for the initial comment (see my comment 3). Patch for the spec posted: http://lists.freedesktop.org/archives/xdg/2012-October/012526.html Spec change pushed, and fixed to desktop-file-utils pushed too. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.