I would so reject this patch. It's logically flawed.
First: 106 QStringList args; 107 if ( argc > 1 ) 108 args=app.arguments();
Later: 154 if(argc <=1) 155 { 156 args=app.arguments(); 157 }
Remove those two occurrences and use: 106 QStringList args; 107 args=app.arguments();
The baseline issue has been args not populated with app.arguments(). It wasn't uninitialized, but empty.
An empty list is basically fine, but this will crash: 161 QString executable=args[0]; 162 args.pop_front();
args[0] is not defined in that case.
Even worse: the Qt documentation for pop_front() specifies: "The list must not be empty."
Please, use proper logic and always set args to app.arguments() without this nonsensical if (argc > 1) ... if (argc <= 1) tautology in two different places.
However, Ionic and I were taking a look at the code last night, and we did not understand why "--child-process" is being added to the args list. It looks like you are adding it when it does not exist in the list. If so, why not just hardcode the behavior that --child-process invokes?
Having had a closer look at the code in question, adding --child-process is fine. It's only added to the forked process's argument list. You can't hardcode the behavior of --child-process, as it's not supposed to be used when you start x2goclient.exe "normally". In contrast, --child-process lets you determine whether a process is the forked child process, or rather the manually by the user started main process.
Feel free to ignore this section, Alex.
Mihai