Review Request 111615: Wrap KoShapeBackground in QSharedPointer

Thorsten Zachmann t.zachmann at zagge.de
Sun Jul 28 13:17:36 BST 2013


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


I did not look though all yet. Looks quite good. Here my comments before I leave now. Will look more when I'm back.


karbon/plugins/tools/KarbonGradientEditStrategy.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27048>

    This and similar places can be simplified to QSharedPointer<KoGradientBackground> newFill (new KoGradientBackground(*fill->gradient(), fill->transform()));



karbon/plugins/tools/KarbonGradientTool.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27049>

    Can be simplified as above



karbon/plugins/tools/KarbonGradientTool.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27050>

    Can be simplified to QSharedPointer<KoGradientBackground> newFill (0); or even QSharedPointer<KoGradientBackground> newFill;



karbon/plugins/tools/KarbonPatternEditStrategy.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27051>

    Can be simplified as above



karbon/plugins/tools/KarbonPatternTool.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27052>

    Shouldn't this used a qSharedPointerDynamicCast instead of data()?



karbon/plugins/tools/KarbonPatternTool.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27053>

    Can be simplified as above



karbon/plugins/tools/KarbonPatternTool.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27054>

    Can be simplified as above



karbon/ui/KarbonView.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27055>

    Can be simplified as above



karbon/ui/KarbonView.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27056>

    Can be simplified as above



krita/ui/opengl/kis_opengl_canvas2.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27057>

    This change seems to be unrelated as the next one



krita/ui/tool/kis_tool_shape.cc
<http://git.reviewboard.kde.org/r/111615/#comment27058>

    This can be simplified as above.



krita/ui/tool/kis_tool_shape.cc
<http://git.reviewboard.kde.org/r/111615/#comment27059>

    This can be simplified as above



libs/flake/KoShape.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27061>

    These look like strange artefacts to me



libs/flake/svg/SvgParser.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27062>

    Can be simplified as above.



libs/flake/svg/SvgParser.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27063>

    Getting the oldFill and clearing it is not needed. Calling setBackground is enough.



libs/flake/svg/SvgParser.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27064>

    Getting the oldFill and clearing it is not needed. Calling setBackground is enough.



libs/flake/tests/TestShapeBackgroundCommand.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27065>

    Can be simplified as above.



libs/widgets/KoFillConfigWidget.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27067>

    Clearing the smart pointer is not needed.



libs/widgets/KoFillConfigWidget.cpp
<http://git.reviewboard.kde.org/r/111615/#comment27068>

    Can not be simplified as above.


- Thorsten Zachmann


On July 28, 2013, 9:46 a.m., Boudewijn Rempt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111615/
> -----------------------------------------------------------
> 
> (Updated July 28, 2013, 9:46 a.m.)
> 
> 
> Review request for Calligra and Jan Hambrecht.
> 
> 
> Description
> -------
> 
> This patch wraps KoShapeBackground in a QPointer instead of doing manual refcounting. Bug 321714 shows, imo, that the manual refcounting is fragile and sometimes breaks. I don't remember why we weren't supposed to use QPointer (other than that it gets a little ugly with subclassing), but it seems a good fit here.
> 
> There are other classes that do manual refcounting, and I think those should be converted, too -- but in another patch.
> 
> 
> This addresses bug 321714.
>     http://bugs.kde.org/show_bug.cgi?id=321714
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt 38c3f62 
>   cmake/modules/FindVc.cmake bb9823f 
>   filters/karbon/wmf/WmfExport.cpp bf0aa85 
>   karbon/plugins/tools/CalligraphyTool/KarbonCalligraphicShape.cpp e9921b8 
>   karbon/plugins/tools/CalligraphyTool/KarbonCalligraphyTool.cpp 2517164 
>   karbon/plugins/tools/KarbonGradientEditStrategy.cpp 0bf30d1 
>   karbon/plugins/tools/KarbonGradientTool.cpp 79d4fde 
>   karbon/plugins/tools/KarbonPatternEditStrategy.h b66b78d 
>   karbon/plugins/tools/KarbonPatternEditStrategy.cpp 1b4e0c0 
>   karbon/plugins/tools/KarbonPatternTool.cpp 5c0ac36 
>   karbon/ui/KarbonView.cpp 7e54ede 
>   karbon/ui/widgets/KarbonPaletteBarWidget.cpp 5898872 
>   karbon/ui/widgets/KarbonSmallStylePreview.cpp f6d76cf 
>   krita/ui/flake/kis_shape_selection_model.cpp 4c59ad0 
>   krita/ui/opengl/kis_opengl_canvas2.cpp 1674ab4 
>   krita/ui/tool/kis_tool_shape.cc aab57dd 
>   krita/ui/widgets/kis_floating_message.cpp d53e133 
>   libs/flake/KoConnectionShape.cpp 09af2dd 
>   libs/flake/KoOdfWorkaround.h 5faa268 
>   libs/flake/KoOdfWorkaround.cpp 8a5b593 
>   libs/flake/KoShape.h fe6cc3f 
>   libs/flake/KoShape.cpp 6d14a8c 
>   libs/flake/KoShapeBackground.h 33253a8 
>   libs/flake/KoShapeBackground.cpp 9d6b29e 
>   libs/flake/KoShapeBackground_p.h 92acc36 
>   libs/flake/KoShape_p.h aa6633c 
>   libs/flake/commands/KoShapeBackgroundCommand.h bee749d 
>   libs/flake/commands/KoShapeBackgroundCommand.cpp f4acd2c 
>   libs/flake/svg/SvgParser.cpp 6898ffc 
>   libs/flake/svg/SvgStyleWriter.h 1327e27 
>   libs/flake/svg/SvgStyleWriter.cpp 8be614a 
>   libs/flake/tests/TestShapeBackgroundCommand.cpp e0b69ba 
>   libs/kopageapp/KoPAPageBase.cpp d56c7fe 
>   libs/kopageapp/KoPAView.cpp 58b4940 
>   libs/kopageapp/tools/backgroundTool/KoPABackgroundToolWidget.cpp c0c5afa 
>   libs/widgets/KoFillConfigWidget.h 4d71718 
>   libs/widgets/KoFillConfigWidget.cpp d086eb7 
>   libs/widgets/KoResourcePopupAction.h 91031e4 
>   libs/widgets/KoResourcePopupAction.cpp 2d873ca 
>   plugins/artistictextshape/ArtisticTextShapeFactory.cpp 37552b8 
>   plugins/chartshape/ChartShape.cpp 55d5eb8 
>   plugins/dockers/styledocker/StrokeFillWidget.h 212eaa0 
>   plugins/dockers/styledocker/StrokeFillWidget.cpp d67cabf 
>   plugins/dockers/styledocker/StyleDocker.h 2408188 
>   plugins/dockers/styledocker/StyleDocker.cpp 052b2ee 
>   plugins/dockers/styledocker/StylePreview.h db33b3f 
>   plugins/dockers/styledocker/StylePreview.cpp 39f8b42 
>   plugins/pathshapes/ellipse/EllipseShapeFactory.cpp 0a4c68d 
>   plugins/pathshapes/enhancedpath/EnhancedPathParameter.cpp 29d2ad2 
>   plugins/pathshapes/enhancedpath/EnhancedPathShapeFactory.cpp f1e3974 
>   plugins/pathshapes/rectangle/RectangleShapeFactory.cpp 689abfe 
>   plugins/pathshapes/star/StarShapeFactory.cpp dd34c06 
>   plugins/textshape/TextShape.cpp b230f0a 
>   stage/part/KPrEndOfSlideShowPage.cpp 061aa58 
>   words/part/KWPageStyle.h b2eeb43 
>   words/part/KWPageStyle.cpp f53dab5 
>   words/part/KWPageStyle_p.h 356af3a 
>   words/part/frames/KWFrameLayout.cpp 6b2a31e 
> 
> Diff: http://git.reviewboard.kde.org/r/111615/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Boudewijn Rempt
> 
>

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


More information about the calligra-devel mailing list