OpenPandora Main OS

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Core
  • Operating System Release 1 (Zaxxon)
  • Severity Low
  • Reported Version SuperZaxxon Final 1.54
Attached to Project: OpenPandora Main OS
Opened by jr - 15.06.2013
Last edited by skeezix - 10.07.2013

FS#322 - Allow removal of categories using the libpnd category config file

Since some PNDs provide nonstandard categories like GTK or GNOME, it is desirable to extend the libpnd category mapping with the ability to suppress individual categories completely.


Closed by  skeezix
10.07.2013 19:51
Reason for closing:  Implemented
Additional comments about closing:  Applied; thanks!
jr commented on 15.06.2013 21:31

The following patch implements this.




From 59eb27c78bd7bd4db1fde6e99cb64efd90c4f6ba Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?J=C3=BCrgen=20R=C3=BChle?= <j-r@online.de>

Date: Sat, 15 Jun 2013 19:33:05 +0200

Subject: [PATCH] Allow mapping categories to nothing



Now a category mapped to the magic string "NoCategory" in the categories config

file will not be added to the Categories field of the desktop file.



Note that the configured default categories are used, if all PND categories get

suppressed using this mechanism.

---

 lib/pnd_desktop.c |    6 ++++--

 1 files changed, 4 insertions(+), 2 deletions(-)



diff --git a/lib/pnd_desktop.c b/lib/pnd_desktop.c

index e6aca21..08ec6b0 100644

--- a/lib/pnd_desktop.c

+++ b/lib/pnd_desktop.c

@@ -537,8 +537,10 @@ int pnd_map_dotdesktop_categories ( pnd_conf_handle c, char *target_buffer, unsi

   #define MAPCAT(field)                            \

     if ( ( t = d -> field ) ) {                             \

       match = pnd_map_dotdesktop_category ( c, t );         \

-      strncat ( target_buffer, match ? match : t, len );    \

-      strncat ( target_buffer, ";", len );                  \

+      if ( !match || strcasecmp ( match, "NoCategory" ) ) { \

+        strncat ( target_buffer, match ? match : t, len );  \

+        strncat ( target_buffer, ";", len );                \

+      }                                                     \

     }

 

   MAPCAT(main_category);

--

1.7.0.2



 



Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing