<div>The following was a conversation between David and me. Sending it to the list since it belongs there.</div><div><br></div><div>On Monday 28 May 2012 17:43:47 Mark wrote:<br>> Hi David,<br>><br>> I've been thinking a bit more about KAction to figure out a way to get rid<br>
> of it completely (along with KShortcut). I think i found that solution.<br>
<br></div><span>OK. Not sure why you're emailing in private rather on k-f-d though...</span><br><div><br>> For starters, the setDefaults/restoreDefaults has to go in QAction. I<br>> mailed Rick about this to see if such a patch for Qt would be accepted.<br>
<br></div><span>The naming would be setDefaultShortcut() or setDefaultShortcuts(), surely :)</span><br><span>If it doesn't say "shortcuts" it gets confusing...</span><br><div>
<br>> Lets for the sake of this mail assume that it does get accepted and ends up<br>> in Qt 5.1.<br><br></div><span>OK.</span><br><div><br>> Then all that's left in KAction is global shortcuts.<br>
<br></div><span>Well there's actually more stuff (like gesture support, but it seems this was</span><br><span>never finished, so we could indeed kill that and wait for it to be in Qt).</span><br>
<span>There's KAuth support, not idea how this works or how it could be done</span><br><span>differently.</span><br><br><span>We should submit setHelpText() to QAction for convenience.</span><br>
<div><br>> So why do we even have global shortcuts in there? Can't we just use<br>> shortcut editor as "register" for global shortcuts?<br><br></div><span>The editor isn't always running ;)</span><br>
<div><br>> That probably means that you get a global sortcut registration function in<br>> code. So something like this:<br>> KSomething::registerGlobalShortcut("name", shortcut); <-- is obviously<br>
> wrong but you get the idea.<br><br></div><span>Yeah, this seems to be the obvious way to move the functionality out of</span><br><span>KAction. Feel free to work on a proof of concept in the frameworks branch, the</span><br>
<span>only way to see if this would work out, is to try it, IMHO.</span><br><br><span>> (KConfig? KGlobal? K..?)</span><br><br><span>Not those, for sure. KConfig doesn't know QtWidgets, KGlobal is on the way out.</span><br>
<span>This should be a new namespace or class, for modularity. Something like</span><br><span>KGlobalShortcutRegister or what not. Or maybe new code in the existing</span><br><span>KGlobalAccel.</span><br>
<span>Problems to solve will include storing data for each action (I'd recommend</span><br><span>dynamic properties for this too), and ensuring that changing the default</span><br><span>shortcut as a user, updates the global shortcut.</span><div>
<br></div>