Diffusion Krita 6f614b5ff291

Delete KisView on closing a view.

Authored by rempt on Feb 27 2017, 11:13 AM.

Description

Delete KisView on closing a view.

This first makes KoCanvasBase a QObject; that used to be impossible
because other calligra applications canvas classes multiply inherited
QWidget and KoCanvasBase. That is no longer a consideration.

Then every local use of a pointer to KoCanvasBase or KisCanvas2 is
protected by QPointer. Now every canvas observer knows when a canvas
has disappeared.

But the canvas is deleted before the canvascontroller widget; that means
that when deleting the canvas, the canvas controller widget would get
confused because the canvas observers' canvas has already been deleted:
unsetCanvas wouldn't be called on the canvas observers, so the logic here
is now that if unsetCanvas is called when deleting the canvas controller
widget, unsetCanvas is always called on all observers.

Note: no dockers crash even if unsetCanvas isn't called at the right time,
but it's still proper to call unsetCanvas to allow dockers to clean up
things like local models linked to the layer model.

Details

Committed
remptFeb 27 2017, 11:13 AM
Parents
R37:4763f5e524c0: Proper change of color space and profile for image through "Image properties"…
Branches
Unknown
Tags
Unknown