gnustep-dev
[Top][All Lists]
Advanced

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

Re: pl2link : output valid categories and ease packaging


From: Fred Kiefer
Subject: Re: pl2link : output valid categories and ease packaging
Date: Mon, 19 Mar 2012 11:27:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120215 Thunderbird/10.0.2

On 18.03.2012 23:24, Philippe Roussel wrote:
Hi,

When building an application, a .desktop file is generated with data
gathered from the .plist file when possible and from static strings when
not. One os the fields, Categories, is set to X-GNUstep. As this isn't a
valid freedesktop category, every package has to ship its own .desktop
file for the application to appear in the right menu.

To fix this, I would like to propose adding a new and optional
FreeDesktopCategories array in the applications .plist files, together
with the following patch :

Index: Tools/pl2link.m
===================================================================
--- Tools/pl2link.m (révision 34938)
+++ Tools/pl2link.m (copie de travail)
@@ -102,8 +102,18 @@
fileContents = [NSMutableString stringWithCapacity: 200];
[fileContents appendString:
@"[Desktop Entry]\nEncoding=UTF-8\nType=Application\n"];
- [fileContents appendString:
- @"Categories=X-GNUstep;\n"];
+ list = [plist objectForKey: @"FreeDesktopCategories"];
+ if (list != nil && [list isKindOfClass: [NSArray class]] && [list
count] > 0)
+ {
+ [fileContents appendString: @"Categories="];
+ [fileContents appendString: [list componentsJoinedByString: @";"]];
+ [fileContents appendString: @";\n"];
+ }
+ else
+ {
+ [fileContents appendString:
+ @"Categories=X-GNUstep;\n"];
+ }
entry = [plist objectForKey: @"ApplicationName"];
if (entry != nil)
{

Comments ?

Fine by me.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]