From kde-core-devel Fri Sep 18 18:15:32 2009 From: David Faure Date: Fri, 18 Sep 2009 18:15:32 +0000 To: kde-core-devel Subject: Re: KCmdLineArgs isSet default values Message-Id: <200909182015.32543.faure () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=125329982904840 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 ", 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).