gnustep-dev
[Top][All Lists]
Advanced

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

pl2link : output valid categories and ease packaging


From: Philippe Roussel
Subject: pl2link : output valid categories and ease packaging
Date: Sun, 18 Mar 2012 23:24:22 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

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 ?

Thanks,
Philippe



reply via email to

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