[Digikam-devel] Using image editor canvas with Preview mode...

Marcel Wiesweg marcel.wiesweg at gmx.de
Fri Apr 6 17:54:24 BST 2007


> Marcel:
>
> How i can fix easily the single image editor core instance problem ? Like
> we have only one instance in memory, the image data are unique and we have
> a conflict between preview image data and whole image data when Preview
> Mode and Image Editor are used at the same time.
>
> I would to not re-implemente all core editor for preview mode. Code must be
> shared to reduce dupplicate implementation. There is certainly a simple way
> to find (:=)))
>
> Any suggestions ? Thanks in advance...

Currently DImgInterface is a singleton. The singleton is accessed from places 
which could easily keep their own object, e.g. as a member of canvas:
editorwindow.cpp
imagewindow.cpp
canvas.cpp
showfoto.cpp

But it is also accessed from all image plugins, these classes:
ImageIFace (!!!)
ImageDlgBase
ImageGuideDlg
CtrlPanelDlg

Here it is necessary to have some "default" DImgInterface.

So to solve this, one could try to:
- make the DImgInterface constructor public
- add a DImgInterface object as a member variable of Canvas
- add a "DImgInterface::defaultInstance()" method (or keep the instance() 
method, no need to rename) for latter classes
- add a DImgInterfacesetDefaultInstance() method to set the default instance - 
called from EditorWindow. Both EditorWindows (ImageWindow, ShowFoto are 
singletons themselves)

Marcel

>
> Gilles



More information about the Digikam-devel mailing list