[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: KDE/kdebase/apps/kdialog
From: Patrick Spendrin <ps_ml () gmx ! de>
Date: 2008-09-02 17:11:07
Message-ID: 48BD73AB.7030403 () gmx ! de
[Download RAW message or body]
David Faure schrieb:
> 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?
I am not sure about that but I think it should work; hm, your solution
is of course the better one, I will fix it in a minute.
>
regards,
Patrick
--
web: http://windows.kde.org
mailing list: kde-windows@kde.org
irc: #kde-windows (irc.freenode.net)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic