Review Request 124902: Delay starting kglobalaccel5 till it's needed

Kevin Funk kfunk at kde.org
Mon Aug 24 12:35:25 UTC 2015



> On Aug. 24, 2015, 11:52 a.m., Kevin Funk wrote:
> > src/kglobalaccel.cpp, line 97
> > <https://git.reviewboard.kde.org/r/124902/diff/1/?file=397839#file397839line97>
> >
> >     Indeed. Just move into iface()?
> 
> Martin Gräßlin wrote:
>     it's also used for setting up the QDBusServiceWatcher in the KGlobalAccelPrivate ctor. So not possible to move it.

Ah, didn't notice.

This is usually solved by introducing a free function in anonymous namespace. I.e. `namespace { QString serviceName() { return QStringLiteral(...); } }`. (Saves the member + better for optimization)


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124902/#review84267
-----------------------------------------------------------


On Aug. 24, 2015, 12:13 p.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124902/
> -----------------------------------------------------------
> 
> (Updated Aug. 24, 2015, 12:13 p.m.)
> 
> 
> Review request for KDE Frameworks and Kevin Funk.
> 
> 
> Repository: kglobalaccel
> 
> 
> Description
> -------
> 
> There are usages of KGlobalAccel in e.g. KActionCollection of xmlgui
> framework which do not require a running kglobalaccel5. But due to the
> way KGlobalAccel inits, it always started the runtime part.
> 
> This change ensures that kglobalaccel5 is only started once it's actually
> needed, by e.g. registering a global shortcut. If an application does
> not use global shortcuts the API should no longer trigger a start of the
> runtime part.
> 
> 
> Diffs
> -----
> 
>   src/kglobalaccel.cpp 3508c870c70a21e76263b7574c20b408cc09a837 
>   src/kglobalaccel_p.h a84f4038dac650ddb0fc1828e67e0851153b4456 
> 
> Diff: https://git.reviewboard.kde.org/r/124902/diff/
> 
> 
> Testing
> -------
> 
> export $(dbus-launch)
> qdbusviewer &
> kate &
> 
> -> kglobalaccel5 gets started
> 
> with the change:
> kglobalaccel5 no longer gets started, when starting an application using global shortcuts, it still gets started
> 
> 
> Thanks,
> 
> Martin Gräßlin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150824/c20d81ae/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list