OpenPandora Main OS

Notice: Undefined index: tasklist_type in /srv/www/vhosts/openpandora.org/domains/bugs.openpandora.org/httpdocs/includes/class.tpl.php(136) : eval()'d code on line 228 Notice: Undefined index: tasklist_type in /srv/www/vhosts/openpandora.org/domains/bugs.openpandora.org/httpdocs/includes/class.tpl.php(136) : eval()'d code on line 233
  • Status Closed
  • Percent Complete
    100%
  • Task Type Feature Request
  • Category Core
  • Operating System Release 1 (Zaxxon)
  • Severity Low
  • Reported Version SuperZaxxon Final 1.54
Attached to Project: OpenPandora Main OS
Opened by Jürgen Rühle - 2013-06-15
Last edited by Jeff - 2013-07-10

FS#321 - Support overriding all category fields with .ovr

Tags: libpnd

Currently only the main category and the first sub category of the main category can be overridden using a .ovr file while libpnd uses additional PXML supplied category date to construct the desktop file. This makes it difficult to work with PNDs that supply unwanted data in these additional fields.

Closed by  Jeff
Wednesday, 10 July 2013, 19:59 GMT
Reason for closing:  Implemented
Additional comments about closing:  Applied! Thanks!
Jürgen Rühle

Saturday, 15 June 2013, 21:22 GMT

Fortunately it is trivial to extend the existing override support. Please consider the following patch (there probably is a better way to supply it:-)

From 78972f82c02c6864eca677f6c4c19c8704664b9e 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:20:15 +0200
Subject: [PATCH] Support more complete category override from .ovr files

Add overide support for subcategory 2 and the alternate category chain.

Also allow full suppression of the alternate main category using the magic
string "NoCategory". Note that the main category still cannot be supressed by
the .ovr file, because it should always use a useful main category.
---
 lib/pnd_discovery.c |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/lib/pnd_discovery.c b/lib/pnd_discovery.c
index 1f43540..6905687 100644
--- a/lib/pnd_discovery.c
+++ b/lib/pnd_discovery.c
@@ -428,6 +428,7 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
       if ( p -> main_category ) {
         free ( p -> main_category );
       }
+      // the override file cannot suppress the main category
       p -> main_category = strdup ( v );
     }
     snprintf ( key, 100, "Application-%u.maincategorysub1", p -> subapp_number );
@@ -440,6 +441,48 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
         p -> main_category1 = strdup ( v );
       }
     }
+    snprintf ( key, 100, "Application-%u.maincategorysub2", p -> subapp_number );
+    if ( ( v = pnd_conf_get_as_char ( ovrh, key ) ) ) {
+      if ( p -> main_category2 ) {
+        free ( p -> main_category2 );
+        p -> main_category2 = NULL;
+      }
+      if ( strcasecmp ( v, "NoSubcategory" ) != 0 ) {
+        p -> main_category2 = strdup ( v );
+      }
+    }
+    // alt categories
+    snprintf ( key, 100, "Application-%u.altcategory", p -> subapp_number );
+    if ( ( v = pnd_conf_get_as_char ( ovrh, key ) ) ) {
+      if ( p -> alt_category ) {
+        free ( p -> alt_category );
+        p -> alt_category = NULL;
+      }
+      // but it makes sense to allow full suppression of the alternate category
+      if ( strcasecmp ( v, "NoCategory" ) != 0 ) {
+        p -> alt_category = strdup ( v );
+          }
+    }
+    snprintf ( key, 100, "Application-%u.altcategorysub1", p -> subapp_number );
+    if ( ( v = pnd_conf_get_as_char ( ovrh, key ) ) ) {
+      if ( p -> alt_category1 ) {
+        free ( p -> alt_category1 );
+        p -> alt_category1 = NULL;
+      }
+      if ( strcasecmp ( v, "NoSubcategory" ) != 0 ) {
+        p -> alt_category1 = strdup ( v );
+      }
+    }
+    snprintf ( key, 100, "Application-%u.altcategorysub2", p -> subapp_number );
+    if ( ( v = pnd_conf_get_as_char ( ovrh, key ) ) ) {
+      if ( p -> alt_category2 ) {
+        free ( p -> alt_category2 );
+        p -> alt_category2 = NULL;
+      }
+      if ( strcasecmp ( v, "NoSubcategory" ) != 0 ) {
+        p -> alt_category2 = strdup ( v );
+      }
+    }
 
       } // got ovr conf loaded?
 
--
1.7.0.2

 

Loading...


Notice: Undefined variable: effort in /srv/www/vhosts/openpandora.org/domains/bugs.openpandora.org/httpdocs/includes/class.tpl.php(136) : eval()'d code on line 18 Notice: Trying to get property of non-object in /srv/www/vhosts/openpandora.org/domains/bugs.openpandora.org/httpdocs/includes/class.tpl.php(136) : eval()'d code on line 18 Warning: Invalid argument supplied for foreach() in /srv/www/vhosts/openpandora.org/domains/bugs.openpandora.org/httpdocs/includes/class.tpl.php(136) : eval()'d code on line 18
Date User Effort (H:M)