----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/106923/ -----------------------------------------------------------
Review request for Okular. Description ------- The purpose of this patch is to shift the responsibility for explicitly deleting annotations away from the Page class. Prior to this patch the Page class would explicitly delete an annotations object that was removed from the page. However, in order to eventually support Undoing and Redoing the creation and removal of annotations from a page it is important that the annotation objects are not automatically deleted upon removal. The Page class now stores QSharedPointers to annotations rather than standard pointers. Page::addAnnotation and Document::addPageAnnotation now require a QSharedPointer rather than a standard pointer. The implication is that the deletion of annotation objects is now managed by the QSharedPointer class rather than the Page class. Currently the only QSharedPointer referencing a particular annotation will be the one help by the page class and so the removal of the annotaion from a page will automatically result in the deletion of the annotation object. However, in the future several QUndoCommands may also have QSharedPointer references to the annotation and in this case the annotation will not be deleted until all of those QUndoCommands have been been destroyed. Diffs ----- core/annotations.cpp 21114af core/document.h d47acec core/document.cpp bddef39 core/page.h a8f2761 core/page.cpp d746382 core/textdocumentgenerator.cpp f370ded generators/djvu/generator_djvu.cpp bc83ed7 generators/poppler/generator_pdf.cpp fcc8dc4 ui/annotationtools.h fdcae1b ui/annotationtools.cpp f2db355 ui/pagepainter.cpp 916a0ab ui/pageviewannotator.cpp 4488639 Diff: http://git.reviewboard.kde.org/r/106923/diff/ Testing ------- Added a kDebug() statement to the destructor of the Annotation class. For both annotations loaded from disk and annotations created during the current session the removal of the annotation from a page still results in the destruction of the annotation object (no annotation memory leak). This is the same behavior as before, only now it is accomplished through the use of QSharedPointers rather than an explicit "delete" call. Thanks, Jon Mease
_______________________________________________ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel