Review Request 109019: Move global shortcut facilities from KAction to KGlobalAccel
Valentin Rusu
kde at rusu.info
Mon Feb 25 21:02:01 UTC 2013
> On Feb. 25, 2013, 8:54 a.m., Kevin Ottens wrote:
> > kdeui/shortcuts/kglobalaccel.cpp, line 673
> > <http://git.reviewboard.kde.org/r/109019/diff/3/?file=114966#file114966line673>
> >
> > Wouldn't it be better to use actionShortcuts here? At that point, you could know about an action because of a default shortcut but it could currently have no shortcut. I'd expect shortcut() and hasShortcut() to be consistent together, but right now they could be out of sync.
> >
> > Beside it would help you get rid of the const_cast which can't stay.
> >
> > Actually I think it could be a simple:
> > return !shortcut(action).toList().isEmpty();
Well, the semantics of the original code was slightly different, as the actions list got updated both when a default shortcut and an active shortcut was registered. So the old isGlobalShortcutEnabled returned true even if the action only had a default shortcut. So I think it's better to lookout the two collections, as this:
return d->actionShortcuts.contains(action) || d->actionDefaultShortcuts.contains(action);
- Valentin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109019/#review27994
-----------------------------------------------------------
On Feb. 22, 2013, 10:59 p.m., Valentin Rusu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109019/
> -----------------------------------------------------------
>
> (Updated Feb. 22, 2013, 10:59 p.m.)
>
>
> Review request for KDE Frameworks, David Faure and Kevin Ottens.
>
>
> Description
> -------
>
> KDELibs cleanup task: move global shortcut facilities from KAction to KGlobalAccel. The second step, registering QActions instead of KActions, will be done after completing this review.
>
>
> Diffs
> -----
>
> KDE5PORTING.html e1b41d1
> kdeui/actions/kaction.h ddaa4de
> kdeui/actions/kaction.cpp ec63a72
> kdeui/actions/kaction_p.h b50e678
> kdeui/shortcuts/kglobalaccel.h ed68bba
> kdeui/shortcuts/kglobalaccel.cpp 36dbab7
> kdeui/shortcuts/kglobalaccel_p.h 04feaba
>
> Diff: http://git.reviewboard.kde.org/r/109019/diff/
>
>
> Testing
> -------
>
> Code compiles
>
>
> Thanks,
>
> Valentin Rusu
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130225/06acc486/attachment.html>
More information about the Kde-frameworks-devel
mailing list