[PATCH] New signal for KKeySequenceWidget

Andreas Hartmetz ahartmetz at gmail.com
Tue Aug 21 01:28:02 BST 2007


On Monday 20 August 2007 22:43:42 Thomas McGuire wrote:
> Hello,
>
> attached a patch which adds a new signal to KKeySequenceWidget. This signal
> is like the existing keySequenceChanged() signal, just with more
> parameters.
>
> The new parameters include the old key sequence and a boolean flag wether
> the key sequence was changed programmatically or by the user.
>
> This is necessary to correctly port the usages of KKeySequenceWidget.
> Currently, the code using the widget is incorrect, because it relies on the
> fact that the new key sequence is not yet set when the signal is emitted.
> This is however not the case anymore with the new KKeySequenceWidget.
> Because of this, reverting to the old shortcut if a conflict occurs is not
> possible.
>
> A quick look at lxr.kde.org reveals that all users outside of KDEUI are
> currently incorrect and could benefit from the new signal.
>
> Attached also a sample change of one of the four usages in KMail.
>
> OK to commit next Monday (27th)?
> (if there are no objections, I'll commit)
>
> Regards,
> Thomas

I'd rather have a virtual validate() function that can be reimplemented, see
http://doc.trolltech.com/qq/qq13-apis.html#staticpolymorphism.
OTOH it could be argued that breaking static polymorphism (interesting term) 
is worth it if not breaking it means too much of a hassle for API users.
Either side has a valid argument, so - anybody else want to comment?

Cheers,
Andreas




More information about the kde-core-devel mailing list