X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fpnd_desktop.c;h=3abf62d294aa8bd2f10760b05d0877b73efb3f1b;hb=8075d3dba75ec1bf935e452595897d160f39244a;hp=da1b01df9b4c870d7739f2f89dde671aaf5e0e8f;hpb=8da4fd010b24c11c6c1b5c7a249e28024fed6b18;p=pandora-libraries.git diff --git a/lib/pnd_desktop.c b/lib/pnd_desktop.c index da1b01d..3abf62d 100644 --- a/lib/pnd_desktop.c +++ b/lib/pnd_desktop.c @@ -103,11 +103,13 @@ unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t // basics if ( p -> object_type == pnd_object_type_directory ) { - snprintf ( buffer, 1020, "Exec=%s%s -p %s -e %s -b %s", - nohup, pndrun, p -> object_path, p -> exec, p -> unique_id ); + snprintf ( buffer, 1020, "Exec=%s%s -p \"%s\" -e \"%s\" -b \"%s\"", + nohup, pndrun, p -> object_path, p -> exec, + p -> appdata_dirname ? p -> appdata_dirname : p -> unique_id ); } else if ( p -> object_type == pnd_object_type_pnd ) { - snprintf ( buffer, 1020, "Exec=%s%s -p %s/%s -e %s -b %s", - nohup, pndrun, p -> object_path, p -> object_filename, p -> exec, p -> unique_id ); + snprintf ( buffer, 1020, "Exec=%s%s -p \"%s/%s\" -e \"%s\" -b \"%s\"", + nohup, pndrun, p -> object_path, p -> object_filename, p -> exec, + p -> appdata_dirname ? p -> appdata_dirname : p -> unique_id ); } // start dir @@ -248,7 +250,7 @@ unsigned char pnd_emit_dotinfo ( char *targetpath, char *pndrun, pnd_disco_t *p // set up - sprintf ( filename, "%s/%s#info.desktop", targetpath, p -> unique_id ); + sprintf ( filename, "%s/%s#%uinfo.desktop", targetpath, p -> unique_id, p -> subapp_number ); // emit @@ -301,6 +303,8 @@ unsigned char pnd_emit_dotinfo ( char *targetpath, char *pndrun, pnd_disco_t *p pnd_conf_get_as_char ( desktoph, "info.viewer_args" ), p -> info_filename ); } else { pargs = NULL; + // WARNING: This might not be quite right; if no viewer-args, shouldn't we still append the info-filename? likewise, + // even if we do have view-args, shouldn't we check if filename is present? } char pndfile [ 1024 ]; @@ -312,9 +316,11 @@ unsigned char pnd_emit_dotinfo ( char *targetpath, char *pndrun, pnd_disco_t *p snprintf ( pndfile, 1020, "%s/%s", p -> object_path, p -> object_filename ); } - if ( ! pnd_apps_exec ( pndrun, pndfile, p -> unique_id, viewer, p -> startdir, pargs, - p -> clockspeed ? atoi ( p -> clockspeed ) : 0, PND_EXEC_OPTION_NORUN ) ) - { + pnd_apps_exec_info_t info; + info.viewer = viewer; + info.args = pargs; + + if ( ! pnd_apps_exec_disco ( pndrun, p, PND_EXEC_OPTION_NORUN | PND_EXEC_OPTION_INFO, &info ) ) { return ( 0 ); }