Quick change so back to single .desktop/info, no assoc .desktops, and no alternative...
[pandora-libraries.git] / lib / pnd_discovery.c
index b6627d2..2fd1882 100644 (file)
@@ -53,6 +53,18 @@ void pnd_disco_destroy ( pnd_disco_t *p ) {
   if ( p -> info_filename ) {  free ( p -> info_filename );       }
   if ( p -> preview_pic1 )  {  free ( p -> preview_pic1 );     }
   if ( p -> preview_pic2 )  {  free ( p -> preview_pic2 );     }
+  if ( p -> version_major ) {  free ( p -> version_major );    }
+  if ( p -> version_minor ) {  free ( p -> version_minor );    }
+  if ( p -> version_release ) {free ( p -> version_release );  }
+  if ( p -> version_build ) {  free ( p -> version_build );    }
+  if ( p -> package_version_major ) { free ( p -> package_version_major ); }
+  if ( p -> package_version_minor ) { free ( p -> package_version_minor ); }
+  if ( p -> package_version_release ) { free ( p -> package_version_release ); }
+  if ( p -> package_version_build ) { free ( p -> package_version_build ); }
+  if ( p -> associationitem1_name ) { free ( p -> associationitem1_name ); }
+  if ( p -> associationitem1_filetype ) { free ( p -> associationitem1_filetype ); }
+  if ( p -> exec_dashdash_args ) { free ( p -> exec_dashdash_args ); }
+
   return;
 }
 
@@ -258,10 +270,10 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
        p -> appdata_dirname = strdup ( pnd_pxml_get_appdata_dirname ( pxmlh ) );
       }
       if ( pnd_pxml_get_clockspeed ( pxmlh ) ) {
-       p -> clockspeed = strdup ( pnd_pxml_get_clockspeed ( pxmlh ) ); 
+       p -> clockspeed = strdup ( pnd_pxml_get_clockspeed ( pxmlh ) );
       }
       if ( pnd_pxml_get_startdir ( pxmlh ) ) {
-       p -> startdir = strdup ( pnd_pxml_get_startdir ( pxmlh ) ); 
+       p -> startdir = strdup ( pnd_pxml_get_startdir ( pxmlh ) );
       }
       // category kruft
       if ( pnd_pxml_get_main_category ( pxmlh ) ) {
@@ -303,6 +315,41 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
       if ( pnd_pxml_get_info_type ( pxmlh ) ) {
        p -> info_type = strdup ( pnd_pxml_get_info_type ( pxmlh ) );
       }
+      if ( pnd_pxml_get_version_major ( pxmlh ) ) {
+   p -> version_major = strdup ( pnd_pxml_get_version_major ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_version_minor ( pxmlh ) ) {
+   p -> version_minor = strdup ( pnd_pxml_get_version_minor ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_version_release ( pxmlh ) ) {
+   p -> version_release = strdup ( pnd_pxml_get_version_release ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_version_build ( pxmlh ) ) {
+   p -> version_build = strdup ( pnd_pxml_get_version_build ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_package_version_major ( pxmlh ) ) {
+       p -> package_version_major = strdup ( pnd_pxml_get_package_version_major ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_package_version_minor ( pxmlh ) ) {
+   p -> package_version_minor = strdup ( pnd_pxml_get_package_version_minor ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_package_version_release ( pxmlh ) ) {
+   p -> package_version_release = strdup ( pnd_pxml_get_package_version_release ( pxmlh ) );
+      }
+      if ( pnd_pxml_get_package_version_build ( pxmlh ) ) {
+   p -> package_version_build = strdup ( pnd_pxml_get_package_version_build ( pxmlh ) );
+      }
+#if 1
+      // file associations
+      if ( pnd_pxml_get_associationitem1_name ( pxmlh ) ) {
+       p -> associationitem1_name = strdup ( pnd_pxml_get_associationitem1_name ( pxmlh ) );
+       p -> associationitem1_filetype = strdup ( pnd_pxml_get_associationitem1_filetype ( pxmlh ) );
+       //pnd_log ( PND_LOG_DEFAULT, "  Disco: Found file association request in PXML (%s)\n", p -> title_en );
+      }
+#endif
+      if ( pnd_pxml_get_execdashdashargs ( pxmlh ) ) {
+       p -> exec_dashdash_args = strdup ( pnd_pxml_get_execdashdashargs ( pxmlh ) );
+      }
 
       // look for any PXML overrides, if requested
       if ( disco_overrides ) {