[Kde-imaging] New KIPI plugins category identification based on KAction detection.

Jesper K. Pedersen blackie at blackie.dk
Wed Jun 16 11:37:41 CEST 2004


On Wednesday 16 June 2004 11:29, Gilles Caulier wrote:
| Le mercredi 16 Juin 2004 11:23, Jesper K. Pedersen a écrit :
| > On Wednesday 16 June 2004 11:16, Gilles Caulier wrote:
| > | Le mercredi 16 Juin 2004 01:35, Aurelien Gateau a écrit :
| > | > > That makes the host application code much simpler, plus removes the
| > | > > need for the KIPI::UNDEFINEDPLUGIN
| > |
| > | This type is necessary if the hosts have passed a bad KAction who can't
| > | parsing by the plugins.
| >
| > If I (as a host app developer) am carefully, I should not get in this
| > problem at all, right?
|
| of course (:=))
|
| > If so, this code is only for the situation where the host app is buggy,
| > for that I suggest that the plugin code instead issue a kdWarning( 51000
| > ) and just returns say ImagesPlugin.
|
| Right for KdWarning.
|
| > Otherwise, carefull host app implementor will be puzzled about when the
| > UNDEFINEDPLUGIN could occur.
|
| The plugin must returned a default value in this case and this value limit
| the warning at the compilation also...
|
| Your viewpoint ?
Just return ImagesPlugin.

Think carefully about it, in KDE in general we do nowhere have enums for 
programming errors, that would just explode the amount of code.
For programming errors we simply use kdWarning().

Do a grep in the KDE source for enums, and you will see enums like:
enum { NoCompression=0, GZipCompression } compression : 4;
enum ServiceType { ST_MOUNT, ST_UNMOUNT, /* ST_PROPERTIES, */ 
ST_USER_DEFINED };
enum ModeType { Copy, Move, Delete, Create, Done };
enum { STATE_LISTING, STATE_CHMODING } state;

and so on and so on. Nowhere you see a UPS_ERROR_TYPE enum value.

Cheers
Jesper.


More information about the Kde-imaging mailing list