[X2Go-Dev] Bug#522: X2Go issue (in src:x2goclient) has been marked as pending for release

Mihai Moldovan ionic at ionic.de
Sun Jun 29 20:02:57 CEST 2014


Hi Alex,

* On 27.06.2014 09:36 pm, Oleksandr Shneyder wrote:
> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4265 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.x2go.org/pipermail/x2go-dev/attachments/20140629/a6b48464/attachment.bin>


More information about the x2go-dev mailing list