<div class="gmail_quote">On Tue, May 29, 2012 at 9:55 AM, Mark <span dir="ltr"><<a href="mailto:markg85@gmail.com" target="_blank">markg85@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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></blockquote><div><br></div><div>Obviously. Proposing the following additions to QAction:</div>
<div>- setDefaultShortcuts</div><div>- defaultShortcuts</div><div>- resetDefaultShortcuts</div><div>- setHelpText (convenient function that sets: setToolTip, setStatusTip and setWhatsThis in one go)</div><div><br></div><div>
- signal: defaultShortcutsRestored (emitted when resetDefaultShortcuts is called)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></blockquote><div><br></div><div>Somehow this smells a little wrong. What does KAuth have to do with a QAction element..</div>
<div>Perhaps KAuth should react on registered shortcuts outside of the QAction (KAction) class. Just "thinking out loud" now. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><span>We should submit setHelpText() to QAction for convenience.</span></blockquote><div><br></div><div>See above. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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></blockquote>
<div><br></div><div>You get the point ;) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></blockquote><div><br></div><div>Awesome. Though not going to start on this one yet. First the tooltip stuff (other discussion in plasma-devel) before i start on something else. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></blockquote>
<div><br></div><div>Note: this is why i added the above defaultShortcutsRestored signal to allow a signal/slot connection when the shortcuts are restored and thus update that in the registered shortcuts. Wherever that might be. I like you suggestion here! I'm not quite sure if this should go in a new global class or added to an existing one. In the docs i also found "KGlobalShortcutInfo" ... what is that one doing anyway? (no documentation) <a href="http://api.kde.org/4.8-api/kdelibs-apidocs/kdeui/html/classKGlobalShortcutInfo.html">http://api.kde.org/4.8-api/kdelibs-apidocs/kdeui/html/classKGlobalShortcutInfo.html</a> From the looks of it, it "seems" to be what is suggested here.. It is being used in just a few places: <a href="http://lxr.kde.org/ident?i=KGlobalShortcutInfo">http://lxr.kde.org/ident?i=KGlobalShortcutInfo</a></div>
</div><br>