[Kde-imaging] Proposed enhancement to KIPIPlugins::ImagesList

Andi Clemens andi.clemens at gmx.net
Mon Dec 8 10:03:46 CET 2008


Hi all,

On Monday 08 December 2008 05:56:59 Gilles Caulier wrote:
> 2008/12/7 Aurélien Gâteau <aurelien.gateau at free.fr>
>
> > Luka Renko wrote:
> > > On Sunday 07 December 2008 19:48:57 Aurélien Gâteau wrote:
> > >> I think the idea is good, but adding another bool to the constructor
> > >> is not a good idea, IMO. It leads to unreadable code like this:
> > >>
> > >> list = new ImagesList(iface, parent, true, false, false, true);
> > >
> > > I agree, I just used the way it was already done for other options (not
> >
> > to
> >
> > > invent new way for only single option).

As you mentioned, this was done to be able to set the layout in the ctor, 
because you normally don't change the layout later. 
I have no problem with setters, but I really guess this will be much more 
complicated.

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.


Andi


More information about the Kde-imaging mailing list