[Kde-imaging] Proposed enhancement to KIPIPlugins::ImagesList
Aurélien Gâteau
aurelien.gateau at free.fr
Mon Dec 8 13:25:06 CET 2008
Andi Clemens wrote:
> We can also do it like it is used in Digikam::EditorToolSettings. One enum for
> everything, like so:
>
> enum ToolCodes {
> ButtonsLeft,
> ButtonsRight,
> ButtonsBelow,
> NoButtons,
> AutoLoad,
> AllowRAW
> }
>
> We still can have defaults, but you don't have to provide them all the time,
> only the things you want to change.
> The widget could be called like this:
>
> ImagesList* imgl = new ImagesList(this, ButtonsBelow | AutoLoad);
>
> You just combine the things you want, the default is to turn them off or in
> case of the buttons, display them on the right.
Having all options crammed into one enum does not sound elegant... but I
agree it is definitely better than a set of bools. It is more readable
and easily extended in a BC way.
I just had a look at the code of ImagesList ctor and it looks like at
least moving autoLoad and allowRaw out would be trivial. I can provide a
patch if you want.
Aurélien
More information about the Kde-imaging
mailing list