Just realized that this construction does have a major problem.
QProcess construction:
QProcess::startDetached("cmd.exe /k C2oooProgConsole.exe -s -d="+selectedDspType
+" -p="+ selectedInterface
+" -h="+ windowsFileName
+" -c");
QProcess::startDetached("cmd.exe /k C2oooProgConsole.exe -s -d="+selectedDspType +" -p="+ selectedInterface +" -h="+ windowsFileName +" -c");
To copy to clipboard, switch view to plain text mode
Problem:
If the variable "windowsFileName" does contains Spaces my QProcess construction does not work.
small example:
a) windowsFileName
C:\testfolder\subfolder\myfile.xy
does work
b) if windowsFileName =
C:\test folder\subfolder\myfile.xy
does NOT work and ends up ion the following error in cmd.exe:
File not found: C:\test
I guess thats the issue cause cmd just cuts the command/path of my file at the moment it reaches the Space. So am i correct, that i need to change my QProcess-construction or better the windowsfileName section to be sure that spaces does not matter anymore ?
But how would i do that ?
Usualy you would just add "" around the path but what is the solution in the contruction above ?
The only theoretical idea i have right now is adding " infront and behind the variable before evne using it. i.e. using prepend and append, but that does not work and i am not sure what is the best method to modify strings AND if this idea is solved better with another method
Bookmarks