I still think, it are the quotes, which are _not_ handled in QProcess.

1.) Compile lyx with QProcess enabled.
2.) Strace -o xx.qprocess -f lyx.
        open file
        export as e.g. pdf
        exit lyx
3.) egrep tex2pdf xx.qprocess| egrep execve
        ==>
                16424 execve("/usr2/kornel/bin/tex2pdf", ["tex2pdf", 
"--overwrite", 
"\'InstallDtree.tex\'", ">", "/dev/null"], [/* 73 vars */] <unfinished ...>
###############

Now the same without QProcess.
 egrep tex2pdf xx.system| egrep execve
        ==>
                19091 execve("/bin/sh", ["sh", "-c", "tex2pdf  --overwrite  
\'InstallDt"...], [/* 73 vars */]) = 0
                19092 execve("/usr2/kornel/bin/tex2pdf", ["tex2pdf", 
"--overwrite", 
"InstallDtree.tex"], [/* 73 vars */]) = 0

#############
I would say, here the "sh" is interpreting arguments and removing quotes.

Interesting is the description of
        void QProcess::setArguments ( const QStringList & args ) [virtual]
...
QProcess does not perform argument substitutions; for example, if you specify 
"*" or "$DISPLAY", these values are passed to the process literally. If you 
want to have the same behavior as the shell provides, you must do the 
substitutions yourself; i.e. instead of specifying a "*" you must specify the 
list of all the filenames in the current directory, and instead of "$DISPLAY" 
you must specify the value of the environment variable DISPLAY. 
...

As I see it, we have to parse the string what.c_str(), isolate each parameter 
and add this parameter via QProcess::addArgument().

        Kornel

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to