apps-menu patch [Re: New tab themes]



fuchur <flohtransporter gmail com> writes:

> Hi,
>
> On Mon, 07 Feb 2011 18:43:54 -0700
> wrote Matthew Love <matth love gmail com>:
>
>>fuchur <flohtransporter gmail com> writes:
>>
>>> Hi,
>>>
>>> On Mon, 7 Feb 2011 20:38:19 +0100
>>> wrote Christopher Roy Bratusek <nano tuxfamily org>:
>>>
>>>>Ahhh... commited without testing (...)
>>>>
>>>>Dark and DarkColor are somewhat blurry now... could you fix it?
>>>>Else... keep up the good work :)
>>>
>>> After build from git i can't start sawfish. I got:
>>>
>>>
>>> rep: using deprecated feature - `0xNN' hexadecimal read syntax
>>>
>>> Lisp backtrace:
>>> #12  string-match ...
>>> #11  string-split ...
>>> #10  split-desktop-entry ...
>>> #9   fdo-menu-entry ...
>>> #8   generate-apps-menu ...
>>> #7   update-apps-menu ...
>>> #6   run-byte-code ...
>>> #4   make-structure (() #<closure 8143028 @ user> #<closure 814303c @
>>> user> user) #2   load ...
>>> #1   run-byte-code ...
>>>
>>> error--> (bad-arg #<subr string-match> () 2)
>>>
>>>
>>> If i can start sawfish i will try to fix it ;).
>>
>>Wondering how an entry got past the exile stage in filtering to be able
>>to get to this error, I noticed that while the exiling would check for
>>the existence of the "Categories" entry in the desktop file, it would
>>not check the entry of that key, allowing nonstrings (possibly nothing),
>>to be passed through, which is what i suspect has happened here.  I
>>added into the 'check-fdo-exile function the checking '(stringp) of the
>>"Categories" entry to make sure it is a valid one.  This should fix this
>>bug.
>>
>>This also moves the 'Emulator' subcategory from 'Games' to 'System'.
>>
>>Cheers
>>
>
> Without this files from /usr/share/applications/ i can start sawfish.
> This files are original install by gentoo from
> gnome-base/nautilus-2.30.1-r1 and x11-plugins/screenlets-0.1.2 
>
>
> http://mitglied.lycos.de/fuchur2004/applications-broken.tar.bz2

Ok, got this fixed, thanks for sending the desktop files.  Attached
patch fixes this bug you found and adds 'ScreenLets' to the 'Desktop'
category, so will show up in the apps-menu now, unless otherwise
discarded. 

Cheers

-- 
Matthew

diff --git a/lisp/sawfish/wm/ext/apps-menu.jl b/lisp/sawfish/wm/ext/apps-menu.jl
index 0c4b4d0..3da4b5b 100644
--- a/lisp/sawfish/wm/ext/apps-menu.jl
+++ b/lisp/sawfish/wm/ext/apps-menu.jl
@@ -97,7 +97,7 @@ filtering on the `apps-menu'.")
   (defvar desktop-cat-alist
     '(("Top-Level" . ("Application" "Applications" "GNOME" "KDE" "X-Xfce-Toplevel"
 		      "GTK" "Qt"))
-      ("Desktop" . ("X-Desktop" "X-DesktopApplets" "X-DesktopCountry"))
+      ("Desktop" . ("X-Desktop" "X-DesktopApplets" "X-DesktopCountry" "Screenlets"))
       ("Office" . ("Office" "WordProcessor" "Presentation" "X-Document"
 		   "TextEditor" "SpreadSheet" "Calculator" "X-Calculate"
 		   "Chart" "FlowChart" "Finance" "Calendar" "ContactManagement"
@@ -507,13 +507,15 @@ If `display-test' is not defined, will return the input desktop-file-list."
     "Split a desktop entry into several entries, each containing one
 of the categories of the original."
     (when fdol
-      (let ((new-fdol fdol))
-	(let loop ((categories
-		    (delete "" (string-split ";" (cdr (assoc "Categories" fdol))))))
-	     (when categories
-	       (append (list 
-			(append new-fdol (list (cons "Category" (car categories)))))
-		       (loop (cdr categories))))))))
+      (let ((new-fdol fdol)
+	    (category-string (cdr (assoc "Categories" fdol))))
+	(when (stringp category-string)
+	  (let loop ((categories
+		      (delete "" (string-split ";" category-string))))
+	       (when categories
+		 (append (list 
+			  (append new-fdol (list (cons "Category" (car categories)))))
+			 (loop (cdr categories)))))))))
 
   ;; Sawfish-menu generation
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]