Making "appdata" work without KApplication

David Faure faure at kde.org
Mon Jun 12 16:40:31 BST 2006


KGlobal::dirs()->saveLocation("appdata") doesn't work when using only KInstance
(and maybe QApplication) in a process - like qtestlib unit tests do.

The attached patch fixes it, by moving the appdata resource creation to a method
that is run when the very first KInstance is created (which becomes KGlobal::instance(), nothing new there).
Any objections?

In fact I think many initialization things in KApplication could move to that new
KGlobal::setMainInstance() private method.
The code that calls QApplication::addLibraryPath() [static] with the paths from the qtplugins resource, for instance.
Any non-GUI initialization, in fact [unless it requires a [QK]Application).

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kglobal-instance-appdata.diff
Type: text/x-diff
Size: 2556 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060612/37ad9a21/attachment.diff>


More information about the kde-core-devel mailing list