KMessageBox return values
Aurélien Gâteau
agateau at kde.org
Wed Oct 2 14:43:49 UTC 2013
On Wednesday 02 October 2013 15:39:20 Aurélien Gâteau wrote:
> Hi,
>
> Working on KMessageBox namespace, I noticed all methods returns int, despite
> the namespace declaring a ButtonCode enum. I gave a try at changing the
> type of the return values to KMessageBox::ButtonCode. This would bring
> better type safety, is still source-compatible (existing code which uses an
> int to store the result still works) and should be done before the first
> kf5 release since it changes the public API.
>
> It mostly works, except for one tricky method: createKMessageBox(). This
> method returns a QDialogButtonBox::StandardButton in most cases, except if
> the dialog is queued or if NoExec is passed in the "options" parameter, in
> which case it returns KMessageBox::Cancel.
>
> I would like to change this behavior to return QDialogButtonBox::NoButton
> instead of KMessageBox::Cancel, making it possible to change
> createKMessageBox() return type to QDialogButtonBox::StandardButton.
Actually, I went ahead and filed a review request:
https://git.reviewboard.kde.org/r/113050/
Aurélien
More information about the Kde-frameworks-devel
mailing list