Quick change so back to single .desktop/info, no assoc .desktops, and no alternative...
[pandora-libraries.git] / lib / pnd_discovery.c
index 615c9c3..2fd1882 100644 (file)
@@ -61,6 +61,10 @@ void pnd_disco_destroy ( pnd_disco_t *p ) {
   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;
 }
 
@@ -335,21 +339,16 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
       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 = pnd_pxml_get_associationitem1_name ( pxmlh );
-       p -> associationitem1_filetype = pnd_pxml_get_associationitem1_filetype ( pxmlh );
-       p -> associationitem1_parameter = pnd_pxml_get_associationitem1_parameter ( pxmlh );
-      }
-      if ( pnd_pxml_get_associationitem2_name ( pxmlh ) ) {
-       p -> associationitem2_name = pnd_pxml_get_associationitem2_name ( pxmlh );
-       p -> associationitem2_filetype = pnd_pxml_get_associationitem2_filetype ( pxmlh );
-       p -> associationitem2_parameter = pnd_pxml_get_associationitem2_parameter ( pxmlh );
-      }
-      if ( pnd_pxml_get_associationitem3_name ( pxmlh ) ) {
-       p -> associationitem3_name = pnd_pxml_get_associationitem3_name ( pxmlh );
-       p -> associationitem3_filetype = pnd_pxml_get_associationitem3_filetype ( pxmlh );
-       p -> associationitem3_parameter = pnd_pxml_get_associationitem3_parameter ( 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