[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: KDE/kdebase/apps/kdialog
From: David Faure <faure () kde ! org>
Date: 2008-09-02 16:58:30
Message-ID: 200809021858.30927.faure () kde ! org
[Download RAW message or body]
On Tuesday 02 September 2008, Patrick Spendrin wrote:
> +#ifdef Q_WS_WIN
> winid = reinterpret_cast<WId>(args->getOption("embed").toLong(&attach, 0)); //C \
> style parsing. If the string begins with "0x", base 16 is used; if the string \
> begins with "0", base 8 is used; otherwise, base 10 is used. +#else
> + winid = args->getOption("embed").toLong(&attach, 0); //C style parsing. \
> If the string begins with "0x", base 16 is used; if the string begins with "0", \
> base 8 is used; otherwise, base 10 is used. +#endif
That's quite some duplication - of code and comment.
Why not factorize it? I suggest:
long embed = args->getOption("embed").toLong(&attach, 0); //C style parsing. If the \
string begins with "0x", base 16 is used; if the string begins with "0", base 8 is \
used; otherwise, base 10 is used. #ifdef Q_WS_WIN
winid = reinterpret_cast<WId>(embed);
#else
winid = embed;
#endif
But --- does it even work? I thought WId was a kind of pointer to a structure on \
Windows, i.e. something that you definitely cannot pass to another process?
--
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic