Review Request 113664: Properly destruct added KoPageWidgetItems on destruction of KoDocumentInfoDlg

Commit Hook null at kde.org
Thu Nov 7 09:53:10 GMT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113664/#review43204
-----------------------------------------------------------


This review has been submitted with commit 90fe250c814d02178b5774b32e61c7066e83606b by Friedrich W. H. Kossebau to branch master.

- Commit Hook


On Nov. 6, 2013, 1:41 p.m., Friedrich W. H. Kossebau wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113664/
> -----------------------------------------------------------
> 
> (Updated Nov. 6, 2013, 1:41 p.m.)
> 
> 
> Review request for Calligra and Boudewijn Rempt.
> 
> 
> Repository: calligra
> 
> 
> Description
> -------
> 
> Fixes crash when semantic items are inserted after the dialog incl. the rdf page was shown & closed
> 
> Seems that KoDocumentInfoDlg is slightly flawed after the port to KPageDialog :/
> For one KPageWidgetItem* are collected in d->pages ("item" vs. "page"), which then are tried to be casted to KoPageWidgetItem*, which is bogus because KoPageWidgetItem is not in any relationship with KPageWidgetItem anymore.
> 
> The initial plan was to make KoPageWidgetItem simply a subclass of KPageWidgetItem. But that has the problem that KPageWidgetItem expects its mainwidget to be passed in the constructor call, so in constructor code of subclasses right here: KoPageWidgetItem::KoPageWidgetItem(...) : KPageWidgetItem(widget) {...}.
> Means, subclasses which would like to be complete page items  setting the widget themselves (like the KoDocumentRdfEditWidget) would have to do some tricks to get their widget already available on call to the baseclass constructor.
> Somehow messy.
> 
> So decided to just do a quick fix for now, by adding a simple adapter/wrapper class, which makes sure that the KoPageWidgetItem is deleted on destruction and that any calls on the KoPageWidgetItem API after casting will happen actually again.
> 
> Hopefully this dialog will be redone in calligra 3.0 (qt5/kf5) properly. Or KoDocumentRdfEditWidget might get a refactoring and things could be done differently, as that is the only calligra-internal page-extension currently.
> 
> Okay to also backport to 2.7?
> 
> 
> Diffs
> -----
> 
>   libs/main/KoDocumentInfoDlg.cpp a8466c1 
> 
> Diff: http://git.reviewboard.kde.org/r/113664/diff/
> 
> 
> Testing
> -------
> 
> No more crashes happening when semantic items are inserted after the dialog incl. the rdf page was shown & closed
> 
> 
> Thanks,
> 
> Friedrich W. H. Kossebau
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20131107/2de6a6f1/attachment.htm>


More information about the calligra-devel mailing list