[Sawfish] Re: [PATCH] apps-menu

[ Thread Index | Date Index ]

On 09/03/2011 10:49 PM, Christopher Roy Bratusek wrote:
On Saturday 03 September 2011 21:20:16 Matthew Love wrote:
Hi All,

Sorry for the delay, but I got this bug fixed.  The problem was that the
xlockmore.desktop file didn't have a "Categories" key, rather it had a
"Category" key; which is not a supported key in the freedesktop.org
desktop file spec.  Normally this wouldn't be a problem, as if a
.desktop entry doesn't have a "Categories" key then it would be
exiled. In this case, apps-menu uses the key "Category" internally, and
had an erroneous check for it in the process that allowed this entry to
pass the exile-checks and crash when "Categories" was not found.  This
patch removes the erroneous check and for good measure renames the
internal "Category" values to "Saw-Category" to avoid any possible
confusion in the future.

( I appologize if this get's double posted, Ive been having some email
issues here )

Thanks, Matthew.

Commited to HEAD. I guess I'll roll-out a 1.8.2 next weekend...





Sawfish ML

Well, I forgot that the internal "Category" key would also be used in some custom user apps-menu filters that someone out there might have, therefore this patch will break some existing user filters.

Attached is a replacement patch that just removes the erroneous "Category" check, which will still fix this bug...but raises some questions.

If ever a desktop entry file has a pre-existing "Category" key and a pre-existing "Categories" key, the "Category" key will over-ride the "Categories" one. For example, if the xlockmore.desktop file also had a "Categories" key the entry would show up in the apps-menu under the category "System;" (unless changed in a user filter).

This shouldn't be a huge problem, as "Category" is not a supported key in the desktop specs and if it's ever present it would usually be used mistakenly as a substitute for "Categories" which simply results in the entry being exiled.

I will look into ways to avert this bug in case it ever comes up.



diff --git a/lisp/sawfish/wm/ext/apps-menu.jl b/lisp/sawfish/wm/ext/apps-menu.jl
index a217f91..6b38140 100644
--- a/lisp/sawfish/wm/ext/apps-menu.jl
+++ b/lisp/sawfish/wm/ext/apps-menu.jl
@@ -363,8 +363,6 @@ with caution, file may be corrupt.\n"))
 exile it."
     (when fdo-list
       (if (or (and (not (assoc "Categories" fdo-list))
-		   (not (stringp (cdr (assoc "Categories" fdo-list))))
-		   (not (assoc "Category" fdo-list))
 		   (not (stringp (cdr (assoc "Categories" fdo-list)))))
 	      (not (assoc "Exec" fdo-list))
 	      (and (not (assoc "Name" fdo-list))

Mail converted by MHonArc 2.6.18 http://listengine.tuxfamily.org/