KCmdLineArgs isSet default values

David Faure faure at kde.org
Fri Sep 18 19:15:32 BST 2009


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 at kde.org, sponsored by Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list