unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t *p ) {
char filename [ FILENAME_MAX ];
- char buffer [ 1024 ];
+ char buffer [ 4096 ];
FILE *f;
// specification
fprintf ( f, "X-Pandora-Info-Name=%s\n", p -> info_name );
}
- if ( p -> associationitem1_name || p -> associationitem2_name || p -> associationitem3_name ) {
- fprintf ( f, "MimeType=" );
- if ( p -> associationitem1_name ) {
- fprintf ( f, "%s;", p -> associationitem1_filetype );
- pnd_log ( PND_LOG_DEFAULT, "App %s is handling mimetype %s [1]\n", p -> title_en, p -> associationitem1_filetype );
- }
- if ( p -> associationitem2_name ) {
- fprintf ( f, "%s;", p -> associationitem2_filetype );
- pnd_log ( PND_LOG_DEFAULT, "App %s is handling mimetype %s [2]\n", p -> title_en, p -> associationitem2_filetype );
- }
- if ( p -> associationitem3_name ) {
- fprintf ( f, "%s;", p -> associationitem3_filetype );
- pnd_log ( PND_LOG_DEFAULT, "App %s is handling mimetype %s [3]\n", p -> title_en, p -> associationitem3_filetype );
- }
- fprintf ( f, "\n" );
- }
-
#if 0 // we let pnd_run.sh command line handle this instead of in .desktop
if ( p -> startdir ) {
snprintf ( buffer, 1020, "Path=%s\n", p -> startdir );
}
#endif
+ // association requests
+ if ( p -> associationitem1_filetype ) {
+ fprintf ( f, "MimeType=%s\n", p -> associationitem1_filetype );
+ }
+
if ( p -> exec ) {
char *nohup;
strncat ( buffer, p -> startdir, 1020 );
}
- // args
+ // args (regular args, for pnd_run.sh to handle)
if ( p -> execargs ) {
char argbuf [ 1024 ];
snprintf ( argbuf, 1000, " -a \"%s\"", p -> execargs );
strncat ( buffer, " -x ", 1020 );
}
+ // args (dashdash -- args, that the shell can screw with before pnd_run.sh gets them)
+ if ( p -> exec_dashdash_args ) {
+ char argbuf [ 4096 ];
+ snprintf ( argbuf, 4096, " -- %s", p -> exec_dashdash_args );
+ strncat ( buffer, argbuf, 4096 );
+ }
+
// newline
strncat ( buffer, "\n", 1020 );