[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KCmdLineArgs isSet default values
From:       David Faure <faure () kde ! org>
Date:       2009-09-18 18:15:32
Message-ID: 200909182015.32543.faure () kde ! org
[Download RAW message or body]

On Friday 18 September 2009, Joseph Wenninger wrote:
> Hi!
> 
> I found some strange behaviour, it's not what I would have needed, but I
> still think it is a bug.
> 
> If an option is defines as
> KCmdLineOptions options;
>   options.add("s");
>   options.add("start <name>", ki18n("Start Kate with a given
> session"),"ANON");
> 
> I think even if --start is not entered at the command line, isSet("start")
> is true and for the argument ANON should be returned. Now isSet("start")
> return false.

Well, technically it was NOT set by the user, so this is arguable...

As long as getOption("start") returns "ANON", I'd say the default
value handling is correct, no?

If you know that you defined "start" with a default value, there is little
point in calling isSet("start"), in fact (especially with your patch, since
then it would always return true).

-- 
David Faure, faure@kde.org, sponsored by Nokia 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