Hi Alex,
The list is never empty, it have at least 1. argument - it is always executable name.
args will be empty on OS X and Linux, if no argument has been passed to x2goclient.exe.
I'll leave my solution here, because in a case of linux or mac if x2goclient started without arguments list don't need to be initialized.
Granted, OS and Linux don't currently use args, but what if they did? I don't like different behavior based on the OS.
If you really want to differentiate, use
106 QStringList args; 107 #ifdef Q_OS_WIN 108 args=app.arguments(); 109 #else 110 if ( argc > 1 ) 111 args=app.arguments(); 112 #endif
And lose the copying in lines 154ff.
That will help keep the code readable.
I still strongly suggest not differentiating based on the OS where not necessary, like in this case.
Mihai