[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Registries
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2006-06-09 14:49:46
Message-ID: 200606091649.50565.boud () valdyas ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


While committing a bit of code I should have committed last Sunday, I suddenly 
realized that the design for that code (SVN commit 549692) may well be 
stupid :-( and cause unnecessary loading of plugin libraries.

In short: what we do now to load a plugin is:

* query for the desktop file with ktrader
* create the plugin
* the plugin creates factory objects and registers them with the registry for 
when we have to create an instance, say, a tool, or a shape, or a colorspace.
* the factory object has a couple of properties for use in the GUI: pixmap, 
name, id, tooltip, description, etc.

But I guess the way I should have done this is:

* query for the desktop file with ktrader
* store the KService::ptr service for when we need something from that plugin
* ask the desktop file for all the properties I mentioned above, store them 
too, and use them in the GUI
* load the library and create the tool, colorspace or whatever only when the 
user uses it. for instance, on the first click on the icon for the tool in 
the toolbar.

The disadvantage of this scheme is that we cannot have more than one 
colorspace, tool or whatever per plugin, which means lots more plugin 
libraries. But I guess the advantage is that we don't even try to load 
the .so. 

And I guess it's always been possible to do this, just that I never grokked 
it.

Or maybe I've managed to confuse myself even worse just now.

-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi

[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic