X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fpnd_discovery.c;h=90baba072eb4d3e01a7417b1742b5ca027c7a358;hb=4a43e7ab969cbb724244e84a164acbe14c7db4cf;hp=7d89475aceea9d5a682c5d2c7794c2bdd9c0ce42;hpb=b2aaaf39eef7bcc2bfa000fbdb9f72e6d0f656c8;p=pandora-libraries.git diff --git a/lib/pnd_discovery.c b/lib/pnd_discovery.c index 7d89475..90baba0 100644 --- a/lib/pnd_discovery.c +++ b/lib/pnd_discovery.c @@ -30,6 +30,7 @@ static char *disco_overrides = NULL; void pnd_disco_destroy ( pnd_disco_t *p ) { if ( p -> package_id ) { free ( p -> package_id); } if ( p -> title_en ) { free ( p -> title_en ); } + if ( p -> desc_en ) { free ( p -> desc_en ); } if ( p -> unique_id ) { free ( p -> unique_id ); } if ( p -> appdata_dirname ) { free ( p -> appdata_dirname ); } if ( p -> icon ) { free ( p -> icon ); } @@ -44,10 +45,34 @@ void pnd_disco_destroy ( pnd_disco_t *p ) { if ( p -> alt_category ) { free ( p -> alt_category ); } if ( p -> alt_category1 ) { free ( p -> alt_category1 ); } if ( p -> alt_category2 ) { free ( p -> alt_category2 ); } + if ( p -> object_filename ) { free ( p -> object_filename ); } + if ( p -> object_path ) { free ( p -> object_path ); } if ( p -> mkdir_sp ) { free ( p -> mkdir_sp ); } if ( p -> info_name ) { free ( p -> info_name ); } if ( p -> info_type ) { free ( p -> info_type ); } 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 -> associationitem1_command ) { free ( p -> associationitem1_command ); } + if ( p -> associationitem1_args ) { free ( p -> associationitem1_args ); } + if ( p -> associationitem2_name ) { free ( p -> associationitem2_name ); } + if ( p -> associationitem2_filetype ) { free ( p -> associationitem2_filetype ); } + if ( p -> associationitem2_command ) { free ( p -> associationitem2_command ); } + if ( p -> associationitem2_args ) { free ( p -> associationitem2_args ); } + if ( p -> associationitem3_name ) { free ( p -> associationitem3_name ); } + if ( p -> associationitem3_filetype ) { free ( p -> associationitem3_filetype ); } + if ( p -> associationitem3_command ) { free ( p -> associationitem3_command ); } + if ( p -> associationitem3_args ) { free ( p -> associationitem3_args ); } return; } @@ -227,11 +252,13 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb, if ( pnd_pxml_get_package_id ( pxmlh ) ) { p -> package_id = strdup ( pnd_pxml_get_package_id ( pxmlh ) ); } - if ( pnd_pxml_get_app_name_en ( pxmlh ) ) { - p -> title_en = strdup ( pnd_pxml_get_app_name_en ( pxmlh ) ); + char *name_en = pnd_pxml_get_app_name_en ( pxmlh ); + if (name_en) { + p -> title_en = name_en; /* already strdupped */ } - if ( pnd_pxml_get_description_en ( pxmlh ) ) { - p -> desc_en = strdup ( pnd_pxml_get_description_en ( pxmlh ) ); + char *desc_en = pnd_pxml_get_description_en ( pxmlh ); + if ( desc_en ) { + p -> desc_en = desc_en; /* already strdupped */ } if ( pnd_pxml_get_icon ( pxmlh ) ) { p -> icon = strdup ( pnd_pxml_get_icon ( pxmlh ) ); @@ -252,10 +279,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 ) ) { @@ -297,6 +324,52 @@ 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 ) ); + p -> associationitem1_command = strdup ( pnd_pxml_get_associationitem1_command ( pxmlh ) ); + p -> associationitem1_args = strdup ( pnd_pxml_get_associationitem1_args ( pxmlh ) ); + //pnd_log ( PND_LOG_DEFAULT, " Disco: Found file association request in PXML (%s)\n", p -> title_en ); + } + if ( pnd_pxml_get_associationitem2_name ( pxmlh ) ) { + p -> associationitem2_name = strdup ( pnd_pxml_get_associationitem2_name ( pxmlh ) ); + p -> associationitem2_filetype = strdup ( pnd_pxml_get_associationitem2_filetype ( pxmlh ) ); + p -> associationitem2_command = strdup ( pnd_pxml_get_associationitem2_command ( pxmlh ) ); + p -> associationitem2_args = strdup ( pnd_pxml_get_associationitem2_args ( pxmlh ) ); + } + if ( pnd_pxml_get_associationitem3_name ( pxmlh ) ) { + p -> associationitem3_name = strdup ( pnd_pxml_get_associationitem3_name ( pxmlh ) ); + p -> associationitem3_filetype = strdup ( pnd_pxml_get_associationitem3_filetype ( pxmlh ) ); + p -> associationitem3_command = strdup ( pnd_pxml_get_associationitem3_command ( pxmlh ) ); + p -> associationitem3_args = strdup ( pnd_pxml_get_associationitem3_args ( pxmlh ) ); + } +#endif // look for any PXML overrides, if requested if ( disco_overrides ) {