char *exec;
char *main_category;
char *clockspeed;
+ char *startdir;
} pnd_disco_t;
void pnd_disco_destroy ( pnd_disco_t *p ); // a function name that simply could not be avoided
// check for validity and add to resultset if it looks executable
if ( pnd_is_pxml_valid_app ( pxmlh ) ) {
- char b [ 1024 ]; // TBD: also lame
+ //char b [ 1024 ]; // TBD: also lame
pnd_disco_t *p;
p = pnd_box_allocinsert ( disco_box, (char*) fpath, sizeof(pnd_disco_t) );
p -> icon = strdup ( pnd_pxml_get_icon ( pxmlh ) );
}
if ( pnd_pxml_get_exec ( pxmlh ) ) {
- snprintf ( b, 1024, "pnd_run_magic %s", pnd_pxml_get_exec ( pxmlh ) );
- p -> exec = strdup ( b );
+ p -> exec = strdup ( pnd_pxml_get_exec ( pxmlh ) );
+ //snprintf ( b, 1024, "pnd_run_magic %s", pnd_pxml_get_exec ( pxmlh ) );
+ //p -> exec = strdup ( b );
}
if ( pnd_pxml_get_unique_id ( pxmlh ) ) {
p -> unique_id = strdup ( pnd_pxml_get_unique_id ( pxmlh ) );
if ( 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 ) );
+ }
} else {
//printf ( "Invalid PXML; skipping.\n" );
pElem=hRoot.FirstChild("icon").Element();
if (pElem)
{
+#if 0
char anotherbuffer [ FILENAME_MAX ];
strcpy ( anotherbuffer, pFilename );
char *s = strstr ( anotherbuffer, PXML_FILENAME );
} else if ( ( s = strrchr ( anotherbuffer, '/' ) ) ) {
s += 1;
strcpy ( s, strdup(pElem->GetText()));
- app->exec = strdup(anotherbuffer);
+ app->icon = strdup(anotherbuffer);
}
+#endif
+ app->icon = strdup ( pElem->GetText() );
}
pElem = hRoot.FirstChild( "description" ).FirstChildElement("en").Element();
pElem=hRoot.FirstChild("exec").Element();
if (pElem)
{
+#if 0
char anotherbuffer [ FILENAME_MAX ];
strcpy ( anotherbuffer, pFilename );
char *s = strstr ( anotherbuffer, PXML_FILENAME );
+ printf ( "exec %s\n", pElem->GetText() );
if ( s ) {
strcpy ( s, strdup(pElem->GetText()));
app->exec = strdup(anotherbuffer);
strcpy ( s, strdup(pElem->GetText()));
app->exec = strdup(anotherbuffer);
}
+#endif
+ app->exec = strdup ( pElem->GetText() );
}
pElem = hRoot.FirstChild( "category" ).FirstChildElement("main").Element();
if ( d -> exec ) {
printf ( " Executable: %s\n", d -> exec );
}
+ if ( d -> startdir ) {
+ printf ( " Start dir: %s\n", d -> startdir );
+ }
if ( d -> clockspeed ) {
printf ( " Clockspeed: %s\n", d -> clockspeed );
}