make kdeui loadable by styles, kill/merge kdefx

David Faure faure at kde.org
Sat Jun 30 22:21:14 BST 2007


On Saturday 30 June 2007, Matthew Woehlke wrote:
> David Faure wrote:
> > On Friday 29 June 2007, Matthew Woehlke wrote:
> >> I know I've heard people talk about wanting to kill/merge kdefx, and I 
> >> recently learned that the reason it exists as a separate library is (at 
> >> least in part) due to some issues loading kdeui outside of a KApplication.
> > ... and problems when unloading libraries.
> > (not depending on kapp is something we have already fixed in kdelibs4).
> 
> Really? ;-)
Yep.

> $ designer -style Plastik
> Fatal error: you need to have a KComponentData object before
> you do anything that requires it! Examples of this are config
> objects, standard directories or translations.
> Aborted
> 
> What's going on here I think is the code tried to do KGlobal::config(), 
> KConfigGroup() and readEntry(), and it choked at one of those steps. I 
> don't think it's doing anything else as far as using objects in kdeui.

Well, none of that has anything to do with KApplication itself.
The application class isn't the problem.
However if you get this error, it means you (well, not you, but
the plastik style) should instanciate a KComponentData instance.

That's the reason for not relying on kapplication anymore: certainly nobody
can change at runtime the kind of qapplication that Qt Designer uses. However
it's dead easy to just instanciate a KComponentData - which will become
the KGlobal::componentData() if it's the first instance of KComponentData
being instanciated, and then KGlobal::config() will work just fine.

> > Write a style that links to kdeui,
> > and send the patch around for people on various systems (including
> > FreeBSD and Solaris if possible, not only Linux) to test it (in particular
> > testing it in Qt designer and Qt-only apps).
> 
> Thanks for the feedback. Patch (for kdelibs/kstyles/plastik) attached; 
> test-able by trying to run Qt-only apps with so-patched Plastik, obviously.

Please add a KComponentData first, this wasn't really the test I was thinking about.
The kde3 problem was much more difficult than this - strange crashes when unloading the style, as I said.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list