move QCoreApplication::addLibraryPath call from KApplication to KComponentData

Thiago Macieira thiago at
Mon Nov 10 11:07:59 GMT 2008

On Monday 10 November 2008 10:05:30 Matthias Kretz wrote:
> Hi,
> please review the attached patch. It makes the first KCD ensure that Qt
> knows about KDE's Qt plugin paths. This is necessary for non-KDE sessions
> where a KDE application that is not using KApplication is started.
> On that topic: I recently fixed krdb.cpp to stop filling up
> ~/.config/Trolltech.conf qt/4.4/libraryPath with lots of path entries. Most
> of you will probably have a lot of duplicate or wrong entries in there (as
> I had). This hurts application startup time (for all Qt apps) and can lead
> to loading plugins from an incorrect path.
> Because of the bug we had in krdb.cpp I think we should do a on-time
> cleaning of that config entry with a kconf_update thingy. What do you
> think?

That means any non-KDE Qt application that loads a KDE plugin (such as Oxygen) 
will get this code run. I don't know if this was your intention, but I felt I 
needed to point out.

Also, the initialisation the way you did it with QBasicAtomicInt isn't thread-
safe. You may as well use a simple boolean.

What you're looking for is the Q_ONCE code that I have not added yet to Qt.

Thiago Macieira - thiago (AT) - thiago (AT)
  Senior Software Engineer - Nokia, Qt Software
  Qt Software is hiring - ask me
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list