getting rid of the ReverseStateChange enum in kxmlguiclient.h

Olivier Goffart ogoffart at kde.org
Fri Mar 23 11:05:18 GMT 2007


Le vendredi 23 mars 2007, Guillaume Laurent a écrit :


> I think this enum should be replaced by a simple bool. As it is, it doesn't
> make the API any clearer than a simple bool would (given the arg is
> named 'reverse').

Wrong, it make reading the code easier.  And we're trying to avoid such bool 
in our API.  Read the following two docs :
http://doc.trolltech.com/qq/qq13-apis.html#thebooleanparametertrap
http://techbase.kde.org/Policies/Library_Code_Policy#Flags


> Moreover, you very often want to call stateChange() through a signal/slot,
> but then having this enum is very unpractical because using it in the
> signal/slot definitions would mean that any object emitting such a signal
> would have to #include <kxmlguiclient.h> just for a single type, 

That's only a minor problem IMO compared to API inconsistancy.

> so you end  up writing the signal/slot taking a bool instead, thus creating
> an inconsistency (albeit a minor one).

If you're talking about  KMainWindow::slotStateChanged , there is indeed a big 
problem in that API. (the "slot" in the name, the bool , and the two 
versions)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070323/363e5fef/attachment.sig>


More information about the kde-core-devel mailing list