[Sawfish] [PATCH] apps-menu |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/sawfish Archives
]
- To: sawfish@xxxxxxxxxxxxxxxxxxx
- Subject: [Sawfish] [PATCH] apps-menu
- From: Matthew Love <matth.love@xxxxxxxxx>
- Date: Sat, 03 Sep 2011 21:20:16 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=lZHo2GpwgxjzH2umdr2moIhLCkdRSZhDPj6ZUj0zs6M=; b=UTiVdVUEpzoPll43L9a0ipzSL7R/nNGKqVJrTFsH2u4uk7mDs52LV8m9fG5wWwHQGl ezbJ5e6KST9bA9+xH6gaaIDTy+0eKzbWxSFPTtXpOC+B1kbsEbo/FNp3DPlHCO15fIE8 Gf2Iv7S7tVR3U1y3m26Bnwn5WNrDx7csebQQ4=
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 )
Cheers
--
matthew
diff --git a/lisp/sawfish/wm/ext/apps-menu.jl b/lisp/sawfish/wm/ext/apps-menu.jl
index a217f91..76c8eb4 100644
--- a/lisp/sawfish/wm/ext/apps-menu.jl
+++ b/lisp/sawfish/wm/ext/apps-menu.jl
@@ -346,9 +346,9 @@ with caution, file may be corrupt.\n"))
(if (assoc "Categories" fdo-list)
(rplacd (assoc "Categories" fdo-list) "Exile")
(setq fdo-list (append fdo-list (cons (cons "Categories" "Exile")))))
- (if (assoc "Category" fdo-list)
- (rplacd (assoc "Category" fdo-list) "Exile")
- (setq fdo-list (append fdo-list (cons (cons "Category" "Exile")))))
+ (if (assoc "Saw-Category" fdo-list)
+ (rplacd (assoc "Saw-Category" fdo-list) "Exile")
+ (setq fdo-list (append fdo-list (cons (cons "Saw-Category" "Exile")))))
;; Set the Exec key if it does not exist
(when (not (assoc "Exec" fdo-list))
(setq fdo-list (append fdo-list (list exile-cmd))))
@@ -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))
@@ -377,12 +375,12 @@ exile it."
(define (fdo-double-check-category fdo-list)
"Make sure the Category key is present and correctly asigned."
(when fdo-list
- (if (assoc "Category" fdo-list)
- (if (or (not (stringp (cdr (assoc "Category" fdo-list))))
- (equal "" (cdr (assoc "Category" fdo-list)))
- (not (stringp (cdr (assoc "Category" fdo-list)))))
- (rplacd (assoc "Category" fdo-list) "Exile"))
- (append fdo-list (cons (cons "Category" "Exile")))))
+ (if (assoc "Saw-Category" fdo-list)
+ (if (or (not (stringp (cdr (assoc "Saw-Category" fdo-list))))
+ (equal "" (cdr (assoc "Saw-Category" fdo-list)))
+ (not (stringp (cdr (assoc "Saw-Category" fdo-list)))))
+ (rplacd (assoc "Saw-Category" fdo-list) "Exile"))
+ (append fdo-list (cons (cons "Saw-Category" "Exile")))))
fdo-list)
(define (determine-desktop-name fdo-list)
@@ -457,7 +455,7 @@ desktop-entry through `fdo-associate-categories'."
"Return the desktop-file-list if the `Category' is of the
Top-Level variety."
(when fdol
- (if (not (equal "Top-Level" (cdr (assoc "Category" fdol))))
+ (if (not (equal "Top-Level" (cdr (assoc "Saw-Category" fdol))))
fdol)))
(define (fdo-default-filter fdol)
@@ -512,7 +510,7 @@ of the categories of the original."
(delete "" (string-split ";" category-string))))
(when categories
(append (list
- (append new-fdol (list (cons "Category" (car categories)))))
+ (append new-fdol (list (cons "Saw-Category" (car categories)))))
(loop (cdr categories)))))))))
;; Sawfish-menu generation
@@ -536,7 +534,7 @@ of the categories of the original."
"Generate a menu entry to run the program specified in the the
desktop file `desk-file'."
(when (car fdo-list)
- (cons (list (cdr (assoc "Category" (car fdo-list)))
+ (cons (list (cdr (assoc "Saw-Category" (car fdo-list)))
(determine-desktop-name (car fdo-list))
(determine-desktop-exec (car fdo-list)))
(generate-menu-entry (cdr fdo-list)))))