From c74e98bc59ca95dd59dae91a265c2020a86380ff Mon Sep 17 00:00:00 2001 From: Anatoly Mihalchenko Date: Wed, 22 Jun 2011 18:24:24 +0200 Subject: [PATCH] Memory leaks checking for Microsoft Visual Studio --- resources/images/toolPalette/triangleTool.png | Bin 0 -> 11360 bytes resources/sankore.qrc | 1 + src/adaptors/UBExportAdaptor.cpp | 2 + src/adaptors/UBExportDocument.cpp | 2 + src/adaptors/UBExportFullPDF.cpp | 3 ++ src/adaptors/UBExportPDF.cpp | 1 + src/adaptors/UBExportWeb.cpp | 2 + src/adaptors/UBImportAdaptor.cpp | 1 + src/adaptors/UBImportDocument.cpp | 2 + src/adaptors/UBImportDocument.h | 1 + src/adaptors/UBImportImage.cpp | 2 + src/adaptors/UBImportImage.h | 1 + src/adaptors/UBImportPDF.cpp | 2 + src/adaptors/UBImportPDF.h | 1 + src/adaptors/UBImportVirtualPrinter.cpp | 1 + src/adaptors/UBIniFileParser.cpp | 2 + src/adaptors/UBMetadataDcSubsetAdaptor.cpp | 2 + src/adaptors/UBSvgSubsetAdaptor.cpp | 23 +++++++++++- src/adaptors/UBThumbnailAdaptor.cpp | 2 + src/adaptors/UBWebPublisher.cpp | 2 +- .../publishing/UBAbstractPublisher.cpp | 2 + .../publishing/UBCapturePublisher.cpp | 1 + src/adaptors/publishing/UBCapturePublisher.h | 1 - .../publishing/UBDocumentPublisher.cpp | 1 + .../publishing/UBSvgSubsetRasterizer.cpp | 2 + .../voting/UBAbstractVotingSystem.cpp | 2 + .../voting/UBReply2005VotingSystem.cpp | 2 + .../voting/UBReplyWRS970VotingSystem.cpp | 2 + src/api/UBLibraryAPI.cpp | 2 + src/api/UBW3CWidgetAPI.cpp | 1 + src/api/UBWidgetMessageAPI.cpp | 2 + src/api/UBWidgetMessageAPI.h | 1 - src/api/UBWidgetUniboardAPI.cpp | 1 + src/api/UBWidgetVotingSystemAPI.cpp | 1 + src/board/UBBoardController.cpp | 7 ++++ src/board/UBBoardPaletteManager.cpp | 1 + src/board/UBBoardView.cpp | 2 + src/board/UBDrawingController.cpp | 2 + src/board/UBLibraryController.cpp | 2 + src/core/UB.h | 18 +++++++-- src/core/UBApplication.cpp | 26 ++++++++++++- src/core/UBApplication.h | 2 + src/core/UBApplicationController.cpp | 6 +++ src/core/UBDisplayManager.cpp | 1 + src/core/UBDocumentManager.cpp | 2 + src/core/UBIdleTimer.cpp | 2 + src/core/UBMimeData.cpp | 2 + src/core/UBPersistenceManager.cpp | 1 + src/core/UBPreferencesController.cpp | 4 ++ src/core/UBSceneCache.cpp | 1 + src/core/UBSetting.cpp | 1 + src/core/UBSettings.cpp | 2 + src/core/main.cpp | 24 +++++++++--- src/desktop/UBCustomCaptureWindow.cpp | 2 + src/desktop/UBDesktopAnnotationController.cpp | 4 ++ src/desktop/UBDesktopEraserPalette.cpp | 3 ++ src/desktop/UBDesktopMarkerPalette.cpp | 2 + src/desktop/UBDesktopPalette.cpp | 1 + src/desktop/UBDesktopPenPalette.cpp | 2 + src/desktop/UBDesktopToolsPalette.cpp | 1 + src/desktop/UBWindowCaptureDelegate_win.cpp | 1 + src/desktop/UBWindowCapture_win.cpp | 2 + src/document/UBDocumentController.cpp | 1 + src/document/UBDocumentProxy.cpp | 1 + src/domain/UBAbstractWidget.cpp | 1 + src/domain/UBAppleWidget.cpp | 1 + src/domain/UBDocumentUndoCommand.cpp | 1 + src/domain/UBGraphicsAudioItem.cpp | 1 + src/domain/UBGraphicsAudioItemDelegate.cpp | 2 + src/domain/UBGraphicsDelegateFrame.cpp | 2 + src/domain/UBGraphicsItemDelegate.cpp | 2 + .../UBGraphicsItemTransformUndoCommand.cpp | 1 + src/domain/UBGraphicsItemUndoCommand.cpp | 2 + src/domain/UBGraphicsMediaItem.cpp | 2 + src/domain/UBGraphicsPDFItem.cpp | 1 + src/domain/UBGraphicsPixmapItem.cpp | 2 + src/domain/UBGraphicsPolygonItem.cpp | 13 ++++++- src/domain/UBGraphicsProxyWidget.cpp | 1 + src/domain/UBGraphicsScene.cpp | 23 ++++++++++++ src/domain/UBGraphicsScene.h | 2 + src/domain/UBGraphicsStroke.cpp | 1 + src/domain/UBGraphicsSvgItem.cpp | 1 + src/domain/UBGraphicsTextItem.cpp | 1 + src/domain/UBGraphicsTextItemDelegate.cpp | 1 + src/domain/UBGraphicsTextItemUndoCommand.cpp | 1 + src/domain/UBGraphicsVideoItem.cpp | 1 + src/domain/UBGraphicsVideoItemDelegate.cpp | 2 +- src/domain/UBGraphicsWidgetItem.cpp | 2 + src/domain/UBGraphicsWidgetItemDelegate.cpp | 1 + src/domain/UBItem.cpp | 2 + src/domain/UBPageSizeUndoCommand.cpp | 1 + src/domain/UBResizableGraphicsItem.cpp | 2 + src/domain/UBW3CWidget.cpp | 2 + src/frameworks/UBBase32.cpp | 2 + src/frameworks/UBCoreGraphicsScene.cpp | 5 ++- src/frameworks/UBCryptoUtils.cpp | 2 + src/frameworks/UBDesktopServices_win.cpp | 1 + src/frameworks/UBFileSystemUtils.cpp | 2 + src/frameworks/UBGeometryUtils.cpp | 2 + src/frameworks/UBPlatformUtils.cpp | 3 +- src/frameworks/UBPlatformUtils.h | 1 + src/frameworks/UBPlatformUtils_linux.cpp | 8 ++++ src/frameworks/UBPlatformUtils_mac.mm | 3 +- src/frameworks/UBPlatformUtils_win.cpp | 9 +++++ src/frameworks/UBStringUtils.cpp | 1 + src/frameworks/UBVersion.cpp | 3 ++ src/gui/UBActionPalette.cpp | 2 + src/gui/UBBlackoutWidget.cpp | 1 + src/gui/UBCircleFrame.cpp | 1 + src/gui/UBClockPalette.cpp | 1 + src/gui/UBColorPicker.cpp | 2 + src/gui/UBDockPalette.cpp | 2 + src/gui/UBDocumentNavigator.cpp | 2 + src/gui/UBDocumentThumbnailWidget.cpp | 2 + src/gui/UBDocumentToolsPalette.cpp | 2 + src/gui/UBDocumentTreeWidget.cpp | 1 + src/gui/UBFavoriteToolPalette.cpp | 1 + src/gui/UBFloatingPalette.cpp | 1 + src/gui/UBIconButton.cpp | 3 ++ src/gui/UBKeyboardPalette.cpp | 3 ++ src/gui/UBKeyboardPalette_win.cpp | 2 + src/gui/UBLibActionBar.cpp | 1 + src/gui/UBLibItemProperties.cpp | 13 ++++--- src/gui/UBLibNavigatorWidget.cpp | 22 ++++++----- src/gui/UBLibPalette.cpp | 35 ++++++++++-------- src/gui/UBLibPathViewer.cpp | 12 +++--- src/gui/UBLibraryWidget.cpp | 32 ++++++++-------- src/gui/UBMainWindow.cpp | 1 + src/gui/UBMessageWindow.cpp | 2 + src/gui/UBMousePressFilter.cpp | 2 + src/gui/UBNavigatorPalette.cpp | 2 + src/gui/UBPageNumberPalette.cpp | 2 + src/gui/UBPropertyPalette.cpp | 2 + src/gui/UBResources.cpp | 2 + src/gui/UBRubberBand.cpp | 2 + src/gui/UBScreenMirror.cpp | 2 + src/gui/UBSpinningWheel.cpp | 2 + src/gui/UBStylusPalette.cpp | 2 + src/gui/UBThumbnailView.cpp | 1 + src/gui/UBThumbnailWidget.cpp | 2 + src/gui/UBToolWidget.cpp | 2 + src/gui/UBToolbarButtonGroup.cpp | 2 + src/gui/UBUpdateDlg.cpp | 2 + src/gui/UBVideoPlayer.cpp | 2 + src/gui/UBWebToolsPalette.cpp | 2 + src/gui/UBWidgetMirror.cpp | 2 + src/gui/UBZoomPalette.cpp | 1 + src/network/UBAutoSaver.cpp | 1 + src/network/UBCookieJar.cpp | 1 + src/network/UBHttpFileDownloader.cpp | 1 + src/network/UBHttpGet.cpp | 1 + src/network/UBNetworkAccessManager.cpp | 2 + src/network/UBServerXMLHttpRequest.cpp | 1 + src/pdf/GraphicsPDFItem.cpp | 2 + src/pdf/PDFRenderer.cpp | 2 + src/pdf/UBWebPluginPDFWidget.cpp | 3 ++ src/pdf/XPDFRenderer.cpp | 3 ++ src/tools/UBAbstractDrawRuler.cpp | 2 + src/tools/UBGraphicsCompass.cpp | 2 + src/tools/UBGraphicsCurtainItem.cpp | 2 + src/tools/UBGraphicsCurtainItemDelegate.cpp | 2 + src/tools/UBGraphicsProtractor.cpp | 2 + src/tools/UBGraphicsProtractor.h | 14 +++---- src/tools/UBGraphicsRuler.cpp | 3 ++ src/tools/UBGraphicsTriangle.cpp | 10 +++++ src/tools/UBGraphicsTriangle.h | 31 ++++++++++++++++ src/tools/UBToolsManager.cpp | 9 +++++ src/tools/UBToolsManager.h | 1 + src/tools/tools.pri | 2 + 169 files changed, 515 insertions(+), 77 deletions(-) create mode 100644 resources/images/toolPalette/triangleTool.png create mode 100644 src/tools/UBGraphicsTriangle.cpp create mode 100644 src/tools/UBGraphicsTriangle.h diff --git a/resources/images/toolPalette/triangleTool.png b/resources/images/toolPalette/triangleTool.png new file mode 100644 index 0000000000000000000000000000000000000000..0421bcea69995c0cc0247009ea0855bee5d20920 GIT binary patch literal 11360 zcmcI~WmH_vmNxG05Tt1|1Zmveg9J?o5TI$S(T2uC8h0nSdmw^CaCdhP4uRkrJTScP zy>su(tXbdpYig}JRkdqBd+&O7t+VRXI^kNH%J?`mI7moH_^K)jI!~?HUlj}E>A8{W zA@bCq!R1u-u$~G6%OdP)j11RNmP0BVrQQ8&(ppwS773{`7WW>E{xrshsl0_FArW-{ zRgsfk5IlPl(z+@dxavAtxq5(IERkd_oXjl&N>CR|4<{EpI6z*PKXq0K^+}KXFFkn| zORy`{$q}Fjb+AMd;sNpU@Pd9&$?82hBmPUlKto*&;^e>${>u)xrvnU0LfR7shS*uU z0?aL~p^lP300004KrJMJZv-_!8ZdcF8>otxi>0oYrXIx04kBs+l$OGg@DzIjJ6O7c z0iF)_j&LzgN#Nf$#h&_qiFts4zg1lAB!T}3+CW1KAn)X22@v4s<${3t1pop<+ZV!HLCl_lTUQtm|9uOZ7A0O9~1{eIjqbt~x%Ms4>41A zrt2@eU~?xoS4kl7FGv3>|6Cjx_Af_{@PCr`L?e$U7{Y7Y-*`&}u&bpMABY#k1>)rb3F(1^#dw9pK%$2K1^*AF{{h!< zvVdB>|6kyOB4PqU|AhY+rGLUDc>W^dzYy~`>wm53f5-vYEfwB3jD#+@2njCs#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Ic}Km?P3`K+^V#QcC(Z)66@iDjAK7E&a0+_BNe;Ry(=l zb%xI5d;t~3ku@0_%+(@dU9VeDHpCr&##(6^qvr#2AFQ9&@+!;kTVsV*z;+l8%Nyg$ zxBGRRTDM#&DX$lpd$Ro&>|#2mZRQMA1%!orCzcT7e55JI`}5Uo?@p0tW+prch54fp zon#M--5Xz@0ZM%cCA{;WIkb@SFS*ti2~jo?6`4U)g;2*0L)ZXdcbdILA8a?4v=Snd zckg0Eym^Kq&?lj)`{41l({FL{SB60b zwTzW06&{lfWx!bmga1_@MP*VCzJ7gkLS_j&K5!Dhflk>hupmSK6IO$9OJkH9&{G0x z&qms{6z0?ba@A=YiqIa5JpP=K4imR{9%fL9&Bxjo$raQg&~lG<@a1_YmbLbmp+@Uo z@SnHcdvMl?StsjDlMAExt#9voDObzNmzEGGknk5T;F9c=O>j7TY=|okHnGicUVpA) zwuCtqhgVK;8i3;v_~uX?{S8`7SMRNh(#7xneJWekbr!bf+ZXOH2wxOr#KaDIx0vwU zqPMDK^lsVMsJvE>yXj+1*$lbX*Spo$yme6FQ|6!Z#@_(bKNMQT9jeQzokPP(xNQ1I zi{!8sgXYftl+?vLDnz5ljfSC9+Fl2h}g>=r5E#9ukboitfN9i;kQdSLrj_-4`mo zl^P|c-lWr=SB^i(1O^7Of(V*O9yfUC^=&jFH^jum=0hll=;UsHvdEhY;ysq=Q#Bww zI)amk3yL2e$%%;_3dUDfMlb7xeg#PT)$B*EwGV_Gw_FK{AgJyltD~{LLgLrNT8hDy$DKDK??lDo4!6!mKi;MHk0D$UvLLGVdmHSg k->paimages/toolPalette/podcast.svg images/toolPalette/podcastOn.svg images/toolPalette/rulerTool.png + images/toolPalette/triangleTool.png images/toolPalette/protractorTool.png images/toolPalette/compassTool.png images/toolPalette/maskTool.png diff --git a/src/adaptors/UBExportAdaptor.cpp b/src/adaptors/UBExportAdaptor.cpp index 9dcc4175..84541c76 100644 --- a/src/adaptors/UBExportAdaptor.cpp +++ b/src/adaptors/UBExportAdaptor.cpp @@ -18,6 +18,8 @@ #include "gui/UBMainWindow.h" +#include "core/memcheck.h" + UBExportAdaptor::UBExportAdaptor(QObject *parent) : QObject(parent) , mIsVerbose(true) diff --git a/src/adaptors/UBExportDocument.cpp b/src/adaptors/UBExportDocument.cpp index ca3ff264..af2ba68f 100644 --- a/src/adaptors/UBExportDocument.cpp +++ b/src/adaptors/UBExportDocument.cpp @@ -17,6 +17,8 @@ #include "quazip.h" #include "quazipfile.h" +#include "core/memcheck.h" + UBExportDocument::UBExportDocument(QObject *parent) : UBExportAdaptor(parent) { diff --git a/src/adaptors/UBExportFullPDF.cpp b/src/adaptors/UBExportFullPDF.cpp index 996ca21f..940a881d 100644 --- a/src/adaptors/UBExportFullPDF.cpp +++ b/src/adaptors/UBExportFullPDF.cpp @@ -29,6 +29,9 @@ #include #include +#include "core/memcheck.h" + + using namespace merge_lib; diff --git a/src/adaptors/UBExportPDF.cpp b/src/adaptors/UBExportPDF.cpp index 0aa4e4f7..b6e16f29 100644 --- a/src/adaptors/UBExportPDF.cpp +++ b/src/adaptors/UBExportPDF.cpp @@ -22,6 +22,7 @@ #include "pdf/GraphicsPDFItem.h" +#include "core/memcheck.h" UBExportPDF::UBExportPDF(QObject *parent) : UBExportAdaptor(parent) diff --git a/src/adaptors/UBExportWeb.cpp b/src/adaptors/UBExportWeb.cpp index 14e28781..de1b710e 100644 --- a/src/adaptors/UBExportWeb.cpp +++ b/src/adaptors/UBExportWeb.cpp @@ -18,6 +18,8 @@ #include "quazip.h" #include "quazipfile.h" +#include "core/memcheck.h" + UBExportWeb::UBExportWeb(QObject *parent) : UBExportAdaptor(parent) { diff --git a/src/adaptors/UBImportAdaptor.cpp b/src/adaptors/UBImportAdaptor.cpp index 6b0729e4..f725075c 100644 --- a/src/adaptors/UBImportAdaptor.cpp +++ b/src/adaptors/UBImportAdaptor.cpp @@ -12,6 +12,7 @@ #include "document/UBDocumentProxy.h" +#include "core/memcheck.h" UBImportAdaptor::UBImportAdaptor(QObject *parent) :QObject(parent) diff --git a/src/adaptors/UBImportDocument.cpp b/src/adaptors/UBImportDocument.cpp index d57e07b7..d46f5064 100644 --- a/src/adaptors/UBImportDocument.cpp +++ b/src/adaptors/UBImportDocument.cpp @@ -19,6 +19,8 @@ #include "quazipfile.h" #include "quazipfileinfo.h" +#include "core/memcheck.h" + UBImportDocument::UBImportDocument(QObject *parent) :UBImportAdaptor(parent) { diff --git a/src/adaptors/UBImportDocument.h b/src/adaptors/UBImportDocument.h index 39c1ca5d..51140c06 100644 --- a/src/adaptors/UBImportDocument.h +++ b/src/adaptors/UBImportDocument.h @@ -10,6 +10,7 @@ #include #include "UBImportAdaptor.h" + class UBDocumentProxy; class UBImportDocument : public UBImportAdaptor diff --git a/src/adaptors/UBImportImage.cpp b/src/adaptors/UBImportImage.cpp index 547ad8c5..356d2870 100644 --- a/src/adaptors/UBImportImage.cpp +++ b/src/adaptors/UBImportImage.cpp @@ -13,6 +13,8 @@ #include "pdf/PDFRenderer.h" +#include "core/memcheck.h" + UBImportImage::UBImportImage(QObject *parent) : UBImportAdaptor(parent) { diff --git a/src/adaptors/UBImportImage.h b/src/adaptors/UBImportImage.h index 9bb198da..d368fe71 100644 --- a/src/adaptors/UBImportImage.h +++ b/src/adaptors/UBImportImage.h @@ -4,6 +4,7 @@ #include #include "UBImportAdaptor.h" + class UBDocumentProxy; class UBImportImage : public UBImportAdaptor diff --git a/src/adaptors/UBImportPDF.cpp b/src/adaptors/UBImportPDF.cpp index 3ea67daa..04c6131e 100644 --- a/src/adaptors/UBImportPDF.cpp +++ b/src/adaptors/UBImportPDF.cpp @@ -12,6 +12,8 @@ #include "pdf/PDFRenderer.h" +#include "core/memcheck.h" + UBImportPDF::UBImportPDF(QObject *parent) : UBImportAdaptor(parent) { diff --git a/src/adaptors/UBImportPDF.h b/src/adaptors/UBImportPDF.h index 69f5c147..aab1cf24 100644 --- a/src/adaptors/UBImportPDF.h +++ b/src/adaptors/UBImportPDF.h @@ -4,6 +4,7 @@ #include #include "UBImportAdaptor.h" + class UBDocumentProxy; class UBImportPDF : public UBImportAdaptor diff --git a/src/adaptors/UBImportVirtualPrinter.cpp b/src/adaptors/UBImportVirtualPrinter.cpp index 7c007913..ca7919c0 100644 --- a/src/adaptors/UBImportVirtualPrinter.cpp +++ b/src/adaptors/UBImportVirtualPrinter.cpp @@ -17,6 +17,7 @@ #include +#include "core/memcheck.h" QString UBImportVirtualPrinter::sOriginalDefaultPrintername = ""; diff --git a/src/adaptors/UBIniFileParser.cpp b/src/adaptors/UBIniFileParser.cpp index c2212105..fa21f1c6 100644 --- a/src/adaptors/UBIniFileParser.cpp +++ b/src/adaptors/UBIniFileParser.cpp @@ -7,6 +7,8 @@ #include "UBIniFileParser.h" +#include "core/memcheck.h" + UBIniFileParser::UBIniFileParser(const QString& pFileName) { QFile file(pFileName); diff --git a/src/adaptors/UBMetadataDcSubsetAdaptor.cpp b/src/adaptors/UBMetadataDcSubsetAdaptor.cpp index 1b0b0d4e..72a54552 100644 --- a/src/adaptors/UBMetadataDcSubsetAdaptor.cpp +++ b/src/adaptors/UBMetadataDcSubsetAdaptor.cpp @@ -16,6 +16,8 @@ #include "document/UBDocumentProxy.h" +#include "core/memcheck.h" + const QString UBMetadataDcSubsetAdaptor::nsRdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; const QString UBMetadataDcSubsetAdaptor::nsDc = "http://purl.org/dc/elements/1.1/"; const QString UBMetadataDcSubsetAdaptor::metadataFilename = "metadata.rdf"; diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 3ddf511b..ef825ab9 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -41,6 +41,8 @@ #include "pdf/PDFRenderer.h" +#include "core/memcheck.h" + const QString UBSvgSubsetAdaptor::nsSvg = "http://www.w3.org/2000/svg"; const QString UBSvgSubsetAdaptor::nsXHtml = "http://www.w3.org/1999/xhtml"; const QString UBSvgSubsetAdaptor::nsXLink = "http://www.w3.org/1999/xlink"; @@ -410,7 +412,14 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() } else if (mXmlReader.name() == "g") { - annotationGroup = new UBGraphicsStroke(); + // Create new stroke, if its NULL or already has poligons + if (annotationGroup) + { + if (!annotationGroup->polygons().empty()) + annotationGroup = new UBGraphicsStroke(); + } + else + annotationGroup = new UBGraphicsStroke(); QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value"); @@ -747,7 +756,11 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() { if (mXmlReader.name() == "g") { - annotationGroup = 0; + if (annotationGroup) + { + if (!annotationGroup->polygons().empty()) + annotationGroup = 0; + } mGroupHasInfo = false; mGroupDarkBackgroundColor = QColor(); mGroupLightBackgroundColor = QColor(); @@ -767,6 +780,12 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() scene->setModified(false); } + if (annotationGroup) + { + if (annotationGroup->polygons().empty()) + delete annotationGroup; + } + return scene; } diff --git a/src/adaptors/UBThumbnailAdaptor.cpp b/src/adaptors/UBThumbnailAdaptor.cpp index 88998c7e..5552a4d1 100644 --- a/src/adaptors/UBThumbnailAdaptor.cpp +++ b/src/adaptors/UBThumbnailAdaptor.cpp @@ -15,6 +15,8 @@ #include "UBSvgSubsetAdaptor.h" +#include "core/memcheck.h" + UBThumbnailAdaptor::UBThumbnailAdaptor(QObject *parent) : QObject(parent) { diff --git a/src/adaptors/UBWebPublisher.cpp b/src/adaptors/UBWebPublisher.cpp index a13ed433..80133b34 100644 --- a/src/adaptors/UBWebPublisher.cpp +++ b/src/adaptors/UBWebPublisher.cpp @@ -11,7 +11,7 @@ #include "adaptors/publishing/UBDocumentPublisher.h" - +#include "core/memcheck.h" UBWebPublisher::UBWebPublisher(QObject *parent) : UBExportAdaptor(parent) diff --git a/src/adaptors/publishing/UBAbstractPublisher.cpp b/src/adaptors/publishing/UBAbstractPublisher.cpp index 0a81c291..9f2d4986 100644 --- a/src/adaptors/publishing/UBAbstractPublisher.cpp +++ b/src/adaptors/publishing/UBAbstractPublisher.cpp @@ -11,6 +11,8 @@ #include "network/UBNetworkAccessManager.h" #include "network/UBServerXMLHttpRequest.h" +#include "core/memcheck.h" + UBAbstractPublisher::UBAbstractPublisher(QObject *parent) : QObject(parent) , mTokenRequest(0) diff --git a/src/adaptors/publishing/UBCapturePublisher.cpp b/src/adaptors/publishing/UBCapturePublisher.cpp index 518e7b0a..09900459 100644 --- a/src/adaptors/publishing/UBCapturePublisher.cpp +++ b/src/adaptors/publishing/UBCapturePublisher.cpp @@ -14,6 +14,7 @@ #include "domain/UBGraphicsScene.h" +#include "core/memcheck.h" UBCapturePublisher::UBCapturePublisher(const QPixmap& pixmap, QObject *parent) : UBAbstractPublisher(parent) diff --git a/src/adaptors/publishing/UBCapturePublisher.h b/src/adaptors/publishing/UBCapturePublisher.h index ad97c0a1..880e24a5 100644 --- a/src/adaptors/publishing/UBCapturePublisher.h +++ b/src/adaptors/publishing/UBCapturePublisher.h @@ -7,7 +7,6 @@ #include "UBAbstractPublisher.h" - class UBServerXMLHttpRequest; class UBCapturePublisher : public UBAbstractPublisher diff --git a/src/adaptors/publishing/UBDocumentPublisher.cpp b/src/adaptors/publishing/UBDocumentPublisher.cpp index 112436b8..3d98d92d 100644 --- a/src/adaptors/publishing/UBDocumentPublisher.cpp +++ b/src/adaptors/publishing/UBDocumentPublisher.cpp @@ -26,6 +26,7 @@ #include "UBSvgSubsetRasterizer.h" +#include "core/memcheck.h" UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *parent) : UBAbstractPublisher(parent) diff --git a/src/adaptors/publishing/UBSvgSubsetRasterizer.cpp b/src/adaptors/publishing/UBSvgSubsetRasterizer.cpp index 6edbba14..ce4ec66e 100644 --- a/src/adaptors/publishing/UBSvgSubsetRasterizer.cpp +++ b/src/adaptors/publishing/UBSvgSubsetRasterizer.cpp @@ -10,6 +10,8 @@ #include "domain/UBGraphicsScene.h" #include "adaptors/UBSvgSubsetAdaptor.h" +#include "core/memcheck.h" + UBSvgSubsetRasterizer::UBSvgSubsetRasterizer(UBDocumentProxy* document, int pageIndex, QObject* parent) : QObject(parent) , mDocument(document) diff --git a/src/adaptors/voting/UBAbstractVotingSystem.cpp b/src/adaptors/voting/UBAbstractVotingSystem.cpp index 1a22dac5..b58eb892 100644 --- a/src/adaptors/voting/UBAbstractVotingSystem.cpp +++ b/src/adaptors/voting/UBAbstractVotingSystem.cpp @@ -16,6 +16,8 @@ #include "gui/UBMainWindow.h" +#include "core/memcheck.h" + UBAbstractVotingSystem::UBAbstractVotingSystem(QObject *parent) : QObject(parent) { diff --git a/src/adaptors/voting/UBReply2005VotingSystem.cpp b/src/adaptors/voting/UBReply2005VotingSystem.cpp index f1c35518..52d68f86 100644 --- a/src/adaptors/voting/UBReply2005VotingSystem.cpp +++ b/src/adaptors/voting/UBReply2005VotingSystem.cpp @@ -9,6 +9,8 @@ #include "core/UBSettings.h" +#include "core/memcheck.h" + UBReply2005VotingSystem::UBReply2005VotingSystem(QWidget *parent) : UBAbstractVotingSystem(parent) , mParent(parent) diff --git a/src/adaptors/voting/UBReplyWRS970VotingSystem.cpp b/src/adaptors/voting/UBReplyWRS970VotingSystem.cpp index 3356394f..65bc45b9 100644 --- a/src/adaptors/voting/UBReplyWRS970VotingSystem.cpp +++ b/src/adaptors/voting/UBReplyWRS970VotingSystem.cpp @@ -10,6 +10,8 @@ #include "core/UBSettings.h" #include "core/UBApplication.h" +#include "core/memcheck.h" + UBReplyWRS970VotingSystem::UBReplyWRS970VotingSystem(QWidget *parent) : UBAbstractVotingSystem(parent) , mParent(parent) diff --git a/src/api/UBLibraryAPI.cpp b/src/api/UBLibraryAPI.cpp index abdf952a..a836724a 100644 --- a/src/api/UBLibraryAPI.cpp +++ b/src/api/UBLibraryAPI.cpp @@ -10,6 +10,8 @@ #include "core/UBApplication.h" #include "board/UBBoardController.h" +#include "core/memcheck.h" + UBLibraryAPI::UBLibraryAPI(QWebView *pWebView) : QObject(pWebView) , mWebView(pWebView) diff --git a/src/api/UBW3CWidgetAPI.cpp b/src/api/UBW3CWidgetAPI.cpp index 2e974fff..875d5886 100644 --- a/src/api/UBW3CWidgetAPI.cpp +++ b/src/api/UBW3CWidgetAPI.cpp @@ -20,6 +20,7 @@ #include "UBWidgetMessageAPI.h" +#include "core/memcheck.h" UBW3CWidgetAPI::UBW3CWidgetAPI(UBGraphicsW3CWidgetItem *graphicsWidget) : QObject(graphicsWidget) diff --git a/src/api/UBWidgetMessageAPI.cpp b/src/api/UBWidgetMessageAPI.cpp index 26f1d461..c5e18c4d 100644 --- a/src/api/UBWidgetMessageAPI.cpp +++ b/src/api/UBWidgetMessageAPI.cpp @@ -11,6 +11,8 @@ #include "domain/UBAbstractWidget.h" +#include "core/memcheck.h" + UBWidgetMessageAPI::UBWidgetMessageAPI(UBW3CWidget *widget) : QObject(widget) , mWebWidget(widget) diff --git a/src/api/UBWidgetMessageAPI.h b/src/api/UBWidgetMessageAPI.h index 83980fe9..8319a64d 100644 --- a/src/api/UBWidgetMessageAPI.h +++ b/src/api/UBWidgetMessageAPI.h @@ -12,7 +12,6 @@ #include "domain/UBGraphicsWidgetItem.h" - class UBWidgetMessageAPI : public QObject { Q_OBJECT; diff --git a/src/api/UBWidgetUniboardAPI.cpp b/src/api/UBWidgetUniboardAPI.cpp index b8c1e9a9..19555866 100644 --- a/src/api/UBWidgetUniboardAPI.cpp +++ b/src/api/UBWidgetUniboardAPI.cpp @@ -19,6 +19,7 @@ #include "UBWidgetMessageAPI.h" +#include "core/memcheck.h" UBWidgetUniboardAPI::UBWidgetUniboardAPI(UBGraphicsScene *pScene, UBGraphicsWidgetItem *widget) : QObject(pScene) diff --git a/src/api/UBWidgetVotingSystemAPI.cpp b/src/api/UBWidgetVotingSystemAPI.cpp index 7ba0a360..42554113 100644 --- a/src/api/UBWidgetVotingSystemAPI.cpp +++ b/src/api/UBWidgetVotingSystemAPI.cpp @@ -9,6 +9,7 @@ #include "adaptors/voting/UBAbstractVotingSystem.h" +#include "core/memcheck.h" UBWidgetVotingSystemAPI::UBWidgetVotingSystemAPI(QObject* parent) : QObject(parent) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 580163e3..69b4d262 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -49,6 +49,8 @@ #include "UBBoardPaletteManager.h" +#include "core/memcheck.h" + UBBoardController::UBBoardController(UBMainWindow* mainWindow) : QObject(mainWindow->centralWidget()) , mMainWindow(mainWindow) @@ -999,6 +1001,11 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString { mActiveScene->addProtractor(pPos); UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); + } + else if (sourceUrl.toString() == UBToolsManager::manager()->triangle.id) + { + mActiveScene->addTriangle(pPos); + UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); } else if (sourceUrl.toString() == UBToolsManager::manager()->mask.id) { diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 1a98bf44..25cecda2 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -50,6 +50,7 @@ #include "UBBoardController.h" +#include "core/memcheck.h" UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardController* pBoardController) : QObject(container) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index d193bdeb..97fc086e 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -39,6 +39,8 @@ #include "frameworks/UBPlatformUtils.h" +#include "core/memcheck.h" + UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent) : QGraphicsView (pParent) , mController (pController) diff --git a/src/board/UBDrawingController.cpp b/src/board/UBDrawingController.cpp index 849be774..7f4829e9 100644 --- a/src/board/UBDrawingController.cpp +++ b/src/board/UBDrawingController.cpp @@ -12,6 +12,8 @@ #include "gui/UBMainWindow.h" +#include "core/memcheck.h" + UBDrawingController* UBDrawingController::sDrawingController = 0; diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 3aff4c39..adb0108d 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -26,6 +26,8 @@ #include "gui/UBThumbnailWidget.h" #include "../core/UBSettings.h" +#include "core/memcheck.h" + static quint32 magicNumber = 0xACDCAFE0; static QString favoriteVirtualPath = "$favorite$"; diff --git a/src/core/UB.h b/src/core/UB.h index 369897ca..37e1dfe1 100644 --- a/src/core/UB.h +++ b/src/core/UB.h @@ -58,9 +58,21 @@ struct UBGraphicsItemType { enum Enum { - PolygonItemType = QGraphicsItem::UserType + 1, PixmapItemType, - SvgItemType, VideoItemType, AudioItemType, AppleWidgetItemType, PDFItemType, TextItemType, W3CWidgetItemType, CurtainItemType, - RulerItemType, CompassItemType, ProtractorItemType, StrokeItemType + PolygonItemType = QGraphicsItem::UserType + 1, + PixmapItemType, + SvgItemType, + VideoItemType, + AudioItemType, + AppleWidgetItemType, + PDFItemType, + TextItemType, + W3CWidgetItemType, + CurtainItemType, + RulerItemType, + CompassItemType, + ProtractorItemType, + StrokeItemType, + TriangleItemType }; }; diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 846792cf..965a92d1 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -45,6 +45,7 @@ #include "ui_mainWindow.h" +#include "core/memcheck.h" QPointer UBApplication::undoStack; @@ -91,7 +92,8 @@ static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event, UBApplication::UBApplication(const QString &id, int &argc, char **argv) - : QtSingleApplication(id, argc, argv) + : QtSingleApplication(id, argc, argv), + mPreferencesController(NULL) { staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor @@ -183,6 +185,12 @@ UBApplication::~UBApplication() delete mUniboardSankoreTransition; mUniboardSankoreTransition = 0; + + if (mPreferencesController) + { + delete mPreferencesController; + mPreferencesController = 0; + } } int UBApplication::exec(const QString& pFileToImport) @@ -537,6 +545,22 @@ bool UBApplication::handleOpenMessage(const QString& pMessage) return true; } +void UBApplication::cleanup() +{ + if (applicationController) delete applicationController; + if (boardController) delete boardController; + if (webController) delete webController; + if (documentController) delete documentController; + if (mUniboardSankoreTransition) delete mUniboardSankoreTransition; + + + applicationController = NULL; + boardController = NULL; + webController = NULL; + documentController = NULL; + mUniboardSankoreTransition = NULL; +} + void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal, bool enabled, const QString& text, QPalette::ColorRole textRole) const { diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h index 76c3f094..ee694d04 100644 --- a/src/core/UBApplication.h +++ b/src/core/UBApplication.h @@ -44,6 +44,8 @@ class UBApplication : public QtSingleApplication int exec(const QString& pFileToImport); + void cleanup(); + static QPointer undoStack; static UBApplicationController *applicationController; diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index c356b4e4..601d5ba1 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -41,6 +41,8 @@ #include #endif +#include "core/memcheck.h" + UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBoardView *pDisplayView, UBMainWindow* pMainWindow, QObject* parent) : QObject(parent) @@ -53,6 +55,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo , mAutomaticCheckForUpdates(false) , mCheckingForUpdates(false) , mIsShowingDesktop(false) + , mFtp(0) { mDisplayManager = new UBDisplayManager(this); @@ -103,6 +106,7 @@ UBApplicationController::~UBApplicationController() delete mBlackScene; delete mMirror; + if (mFtp) delete mFtp; } @@ -479,6 +483,8 @@ void UBApplicationController::showSankoreEditor() void UBApplicationController::checkUpdate() { + if (mFtp!=NULL) + delete mFtp; mFtp = new QFtp(this); connect(mFtp, SIGNAL(commandFinished(int,bool)), this, SLOT(ftpCommandFinished(int,bool))); diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index cdeb6048..aa2f824d 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -18,6 +18,7 @@ #include "ui_blackoutWidget.h" +#include "core/memcheck.h" UBDisplayManager::UBDisplayManager(QObject *parent) : QObject(parent) diff --git a/src/core/UBDocumentManager.cpp b/src/core/UBDocumentManager.cpp index 1f16c977..e041ecc9 100644 --- a/src/core/UBDocumentManager.cpp +++ b/src/core/UBDocumentManager.cpp @@ -28,6 +28,8 @@ #include "UBSettings.h" #include "UBPersistenceManager.h" +#include "core/memcheck.h" + UBDocumentManager* UBDocumentManager::sDocumentManager = 0; UBDocumentManager* UBDocumentManager::documentManager() diff --git a/src/core/UBIdleTimer.cpp b/src/core/UBIdleTimer.cpp index 6fcf0ed2..e6bb73ab 100644 --- a/src/core/UBIdleTimer.cpp +++ b/src/core/UBIdleTimer.cpp @@ -11,6 +11,8 @@ #include "board/UBBoardController.h" #include "board/UBBoardView.h" +#include "core/memcheck.h" + UBIdleTimer::UBIdleTimer(QObject *parent) : QObject(parent) , mCursorIsHidden(false) diff --git a/src/core/UBMimeData.cpp b/src/core/UBMimeData.cpp index 9718c83a..9839a600 100644 --- a/src/core/UBMimeData.cpp +++ b/src/core/UBMimeData.cpp @@ -12,6 +12,8 @@ #include "core/UBApplication.h" #include "domain/UBItem.h" +#include "core/memcheck.h" + UBMimeDataItem::UBMimeDataItem(UBDocumentProxy* proxy, int sceneIndex) : mProxy(proxy) , mSceneIndex(sceneIndex) diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index a467ffce..2729c10e 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -24,6 +24,7 @@ #include "adaptors/UBThumbnailAdaptor.h" #include "adaptors/UBMetadataDcSubsetAdaptor.h" +#include "core/memcheck.h" const QString UBPersistenceManager::imageDirectory = "images"; // added to UBPersistenceManager::mAllDirectories const QString UBPersistenceManager::objectDirectory = "objects"; // added to UBPersistenceManager::mAllDirectories diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp index 0124518b..a8759889 100644 --- a/src/core/UBPreferencesController.cpp +++ b/src/core/UBPreferencesController.cpp @@ -22,6 +22,8 @@ #include "ui_preferences.h" +#include "core/memcheck.h" + qreal UBPreferencesController::sSliderRatio = 10.0; qreal UBPreferencesController::sMinPenWidth = 0.5; qreal UBPreferencesController::sMaxPenWidth = 50.0; @@ -43,6 +45,8 @@ UBPreferencesController::UBPreferencesController(QWidget *parent) UBPreferencesController::~UBPreferencesController() { + delete mPreferencesWindow; + delete mPreferencesUI; delete mPenProperties; diff --git a/src/core/UBSceneCache.cpp b/src/core/UBSceneCache.cpp index f3e24918..bf25642e 100644 --- a/src/core/UBSceneCache.cpp +++ b/src/core/UBSceneCache.cpp @@ -9,6 +9,7 @@ #include "document/UBDocumentProxy.h" +#include "core/memcheck.h" UBSceneCache::UBSceneCache() : mCachedSceneCount(0) diff --git a/src/core/UBSetting.cpp b/src/core/UBSetting.cpp index 317e51d9..555bb48e 100644 --- a/src/core/UBSetting.cpp +++ b/src/core/UBSetting.cpp @@ -11,6 +11,7 @@ #include "UBSettings.h" +#include "core/memcheck.h" UBSetting::UBSetting(UBSettings* parent) : QObject(parent) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index b1d96bd0..ec8a59e9 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -21,6 +21,8 @@ #include "tools/UBToolsManager.h" +#include "core/memcheck.h" + QPointer UBSettings::sSingleton = 0; int UBSettings::pointerDiameter = 40; diff --git a/src/core/main.cpp b/src/core/main.cpp index f81d7423..a608a466 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1,16 +1,21 @@ #include #include -#if (defined(Q_WS_WIN) && defined(_DEBUG)) -//#include -#endif - #include "frameworks/UBPlatformUtils.h" #include "frameworks/UBFileSystemUtils.h" #include "UBApplication.h" #include "UBSettings.h" +#if defined(WIN32) && defined(_DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include + #define DEBUG_NEW new( _NORMAL_BLOCK, __FILE__, __LINE__ ) + #define new DEBUG_NEW +#endif + + void ub_message_output(QtMsgType type, const char *msg) { // We must temporarily remove the handler to avoid the infinite recursion of // ub_message_output -> qt_message_output -> ub_message_output -> qt_message_output ... @@ -47,7 +52,12 @@ void ub_message_output(QtMsgType type, const char *msg) { qInstallMsgHandler(previousHandler); } -int main(int argc, char *argv[]) { +int main(int argc, char *argv[]) +{ +#if defined(_MSC_VER) && defined(_DEBUG) + _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); +#endif + Q_INIT_RESOURCE(sankore); qInstallMsgHandler(ub_message_output); @@ -96,8 +106,12 @@ int main(int argc, char *argv[]) { int result = app.exec(fileToOpen); + app.cleanup(); + qDebug() << "application is quitting"; + + return result; } diff --git a/src/desktop/UBCustomCaptureWindow.cpp b/src/desktop/UBCustomCaptureWindow.cpp index 0260bcba..e25e8963 100644 --- a/src/desktop/UBCustomCaptureWindow.cpp +++ b/src/desktop/UBCustomCaptureWindow.cpp @@ -9,6 +9,8 @@ #include "gui/UBRubberBand.h" +#include "core/memcheck.h" + UBCustomCaptureWindow::UBCustomCaptureWindow(QWidget *parent) : QDialog(parent, Qt::FramelessWindowHint | Qt::Window) , mSelectionBand(0) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index c9707857..08a8b5cb 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -36,6 +36,8 @@ #include "gui/UBKeyboardPalette.h" +#include "core/memcheck.h" + UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) : QObject(parent) , mTransparentDrawingView(0) @@ -138,6 +140,7 @@ UBDesktopAnnotationController::~UBDesktopAnnotationController() delete mTransparentDrawingScene; delete mTransparentDrawingView; + /* if(NULL != mDesktopPenPalette) { delete mDesktopPalette; @@ -158,6 +161,7 @@ UBDesktopAnnotationController::~UBDesktopAnnotationController() delete mLibPalette; mLibPalette = NULL; } + */ } diff --git a/src/desktop/UBDesktopEraserPalette.cpp b/src/desktop/UBDesktopEraserPalette.cpp index 917200b9..c74883a3 100644 --- a/src/desktop/UBDesktopEraserPalette.cpp +++ b/src/desktop/UBDesktopEraserPalette.cpp @@ -7,6 +7,9 @@ #include "gui/UBMainWindow.h" #include "gui/UBToolbarButtonGroup.h" + +#include "core/memcheck.h" + UBDesktopEraserPalette::UBDesktopEraserPalette(QWidget *parent) : UBPropertyPalette(Qt::Horizontal, parent) { diff --git a/src/desktop/UBDesktopMarkerPalette.cpp b/src/desktop/UBDesktopMarkerPalette.cpp index d5ba7c30..b412390b 100644 --- a/src/desktop/UBDesktopMarkerPalette.cpp +++ b/src/desktop/UBDesktopMarkerPalette.cpp @@ -6,6 +6,8 @@ #include "gui/UBMainWindow.h" #include "gui/UBToolbarButtonGroup.h" +#include "core/memcheck.h" + UBDesktopMarkerPalette::UBDesktopMarkerPalette(QWidget *parent) : UBPropertyPalette(Qt::Horizontal, parent) { diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index 00af2ab0..2b565c1a 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -19,6 +19,7 @@ #include "gui/UBMainWindow.h" +#include "core/memcheck.h" UBDesktopPalette::UBDesktopPalette(QWidget *parent) : UBActionPalette(Qt::TopLeftCorner, parent) diff --git a/src/desktop/UBDesktopPenPalette.cpp b/src/desktop/UBDesktopPenPalette.cpp index 6fde69fd..14c3bb9c 100644 --- a/src/desktop/UBDesktopPenPalette.cpp +++ b/src/desktop/UBDesktopPenPalette.cpp @@ -6,6 +6,8 @@ #include "gui/UBMainWindow.h" #include "gui/UBToolbarButtonGroup.h" +#include "core/memcheck.h" + UBDesktopPenPalette::UBDesktopPenPalette(QWidget *parent) : UBPropertyPalette(Qt::Horizontal, parent) { diff --git a/src/desktop/UBDesktopToolsPalette.cpp b/src/desktop/UBDesktopToolsPalette.cpp index d27ca98e..b3828d26 100644 --- a/src/desktop/UBDesktopToolsPalette.cpp +++ b/src/desktop/UBDesktopToolsPalette.cpp @@ -9,6 +9,7 @@ #include "gui/UBMainWindow.h" #include "gui/UBToolbarButtonGroup.h" +#include "core/memcheck.h" UBDesktopToolsPalette::UBDesktopToolsPalette(QWidget *parent) : UBActionPalette(Qt::Horizontal, parent) diff --git a/src/desktop/UBWindowCaptureDelegate_win.cpp b/src/desktop/UBWindowCaptureDelegate_win.cpp index a06b85e6..dbb5d7e1 100644 --- a/src/desktop/UBWindowCaptureDelegate_win.cpp +++ b/src/desktop/UBWindowCaptureDelegate_win.cpp @@ -1,6 +1,7 @@ #include "UBWindowCaptureDelegate_win.h" #include +#include "core/memcheck.h" UBWindowCaptureDelegate::UBWindowCaptureDelegate(QObject *parent) :QObject(parent) diff --git a/src/desktop/UBWindowCapture_win.cpp b/src/desktop/UBWindowCapture_win.cpp index f98f2593..226c7fcb 100644 --- a/src/desktop/UBWindowCapture_win.cpp +++ b/src/desktop/UBWindowCapture_win.cpp @@ -13,6 +13,8 @@ #include "board/UBBoardView.h" +#include "core/memcheck.h" + UBWindowCapture::UBWindowCapture(UBDesktopAnnotationController *parent) : QObject(parent) , mParent(parent) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index dafacb87..34600c79 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -39,6 +39,7 @@ #include "ui_documents.h" #include "ui_mainWindow.h" +#include "core/memcheck.h" UBDocumentController::UBDocumentController(UBMainWindow* mainWindow) : QObject(mainWindow->centralWidget()) diff --git a/src/document/UBDocumentProxy.cpp b/src/document/UBDocumentProxy.cpp index e2782953..5ae89f75 100644 --- a/src/document/UBDocumentProxy.cpp +++ b/src/document/UBDocumentProxy.cpp @@ -14,6 +14,7 @@ #include "core/UBSettings.h" #include "core/UBDocumentManager.h" +#include "core/memcheck.h" UBDocumentProxy::UBDocumentProxy() : mPageCount(0) diff --git a/src/domain/UBAbstractWidget.cpp b/src/domain/UBAbstractWidget.cpp index 339bed48..e918e035 100644 --- a/src/domain/UBAbstractWidget.cpp +++ b/src/domain/UBAbstractWidget.cpp @@ -24,6 +24,7 @@ #include "web/UBWebKitUtils.h" #include "web/UBWebController.h" +#include "core/memcheck.h" QStringList UBAbstractWidget::sInlineJavaScripts; bool UBAbstractWidget::sInlineJavaScriptLoaded = false; diff --git a/src/domain/UBAppleWidget.cpp b/src/domain/UBAppleWidget.cpp index 75b7b199..db8ef30c 100644 --- a/src/domain/UBAppleWidget.cpp +++ b/src/domain/UBAppleWidget.cpp @@ -16,6 +16,7 @@ #include "network/UBNetworkAccessManager.h" +#include "core/memcheck.h" UBAppleWidget::UBAppleWidget(const QUrl& pWidgetUrl, QWidget *parent) : UBAbstractWidget(pWidgetUrl, parent) diff --git a/src/domain/UBDocumentUndoCommand.cpp b/src/domain/UBDocumentUndoCommand.cpp index 835c73c4..50501411 100644 --- a/src/domain/UBDocumentUndoCommand.cpp +++ b/src/domain/UBDocumentUndoCommand.cpp @@ -10,6 +10,7 @@ #include "document/UBDocumentProxy.h" #include "UBGraphicsScene.h" +#include "core/memcheck.h" UBDocumentUndoCommand::UBDocumentUndoCommand(UBDocumentProxy* pDocument, const QList& pOldScenes, const QList& pNewScenes, const int& pActiveSceneIndex) diff --git a/src/domain/UBGraphicsAudioItem.cpp b/src/domain/UBGraphicsAudioItem.cpp index 5c97435b..9c800469 100644 --- a/src/domain/UBGraphicsAudioItem.cpp +++ b/src/domain/UBGraphicsAudioItem.cpp @@ -2,6 +2,7 @@ #include "UBGraphicsAudioItemDelegate.h" #include "UBGraphicsDelegateFrame.h" +#include "core/memcheck.h" UBGraphicsAudioItem::UBGraphicsAudioItem(const QUrl& pAudioFileUrl, QGraphicsItem *parent): UBGraphicsMediaItem(pAudioFileUrl,parent) diff --git a/src/domain/UBGraphicsAudioItemDelegate.cpp b/src/domain/UBGraphicsAudioItemDelegate.cpp index 053bce03..25b396a4 100644 --- a/src/domain/UBGraphicsAudioItemDelegate.cpp +++ b/src/domain/UBGraphicsAudioItemDelegate.cpp @@ -3,6 +3,8 @@ #include "domain/UBGraphicsDelegateFrame.h" #include "UBGraphicsScene.h" +#include "core/memcheck.h" + UBGraphicsAudioItemDelegate::UBGraphicsAudioItemDelegate ( UBGraphicsAudioItem* pDelegated, QObject *parent ) : UBGraphicsItemDelegate ( pDelegated, parent ) , mDelegated ( pDelegated ) diff --git a/src/domain/UBGraphicsDelegateFrame.cpp b/src/domain/UBGraphicsDelegateFrame.cpp index 50d0433b..d7b741a3 100644 --- a/src/domain/UBGraphicsDelegateFrame.cpp +++ b/src/domain/UBGraphicsDelegateFrame.cpp @@ -19,6 +19,8 @@ #include "gui/UBResources.h" +#include "core/memcheck.h" + qreal const UBGraphicsDelegateFrame::mAngleTolerance = 6; UBGraphicsDelegateFrame::UBGraphicsDelegateFrame(UBGraphicsItemDelegate* pDelegate, QRectF pRect, qreal pFrameWidth, bool respectRatio) diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 5fb14cba..80d9b464 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -35,6 +35,8 @@ #include "frameworks/UBFileSystemUtils.h" #include "board/UBDrawingController.h" +#include "core/memcheck.h" + class UBGraphicsParaschoolEditorWidgetItem; UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent, bool respectRatio, bool canRotate) diff --git a/src/domain/UBGraphicsItemTransformUndoCommand.cpp b/src/domain/UBGraphicsItemTransformUndoCommand.cpp index 2a328c88..357fa264 100644 --- a/src/domain/UBGraphicsItemTransformUndoCommand.cpp +++ b/src/domain/UBGraphicsItemTransformUndoCommand.cpp @@ -8,6 +8,7 @@ #include "UBGraphicsItemTransformUndoCommand.h" #include "UBResizableGraphicsItem.h" +#include "core/memcheck.h" UBGraphicsItemTransformUndoCommand::UBGraphicsItemTransformUndoCommand(QGraphicsItem* pItem, const QPointF& prevPos, const QTransform& prevTransform, const qreal& prevZValue, diff --git a/src/domain/UBGraphicsItemUndoCommand.cpp b/src/domain/UBGraphicsItemUndoCommand.cpp index 6a14eb66..a80d0f87 100644 --- a/src/domain/UBGraphicsItemUndoCommand.cpp +++ b/src/domain/UBGraphicsItemUndoCommand.cpp @@ -11,6 +11,8 @@ #include "UBGraphicsScene.h" +#include "core/memcheck.h" + UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, const QSet& pRemovedItems, const QSet& pAddedItems) diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index 5d1d4bae..3f0ddaa6 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -8,6 +8,8 @@ #include "board/UBBoardController.h" +#include "core/memcheck.h" + bool UBGraphicsMediaItem::sIsMutedByDefault = false; UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent) diff --git a/src/domain/UBGraphicsPDFItem.cpp b/src/domain/UBGraphicsPDFItem.cpp index ca6af561..4739b1c7 100644 --- a/src/domain/UBGraphicsPDFItem.cpp +++ b/src/domain/UBGraphicsPDFItem.cpp @@ -7,6 +7,7 @@ #include "UBGraphicsPixmapItem.h" #include "UBGraphicsItemDelegate.h" +#include "core/memcheck.h" UBGraphicsPDFItem::UBGraphicsPDFItem(PDFRenderer *renderer, int pageNumber, QGraphicsItem* parent) : GraphicsPDFItem(renderer, pageNumber, parent) diff --git a/src/domain/UBGraphicsPixmapItem.cpp b/src/domain/UBGraphicsPixmapItem.cpp index 30b84c99..5bb5a5fa 100644 --- a/src/domain/UBGraphicsPixmapItem.cpp +++ b/src/domain/UBGraphicsPixmapItem.cpp @@ -15,6 +15,8 @@ #include "UBGraphicsItemDelegate.h" +#include "core/memcheck.h" + UBGraphicsPixmapItem::UBGraphicsPixmapItem(QGraphicsItem* parent/*, QString pSource*/) : QGraphicsPixmapItem(parent) { diff --git a/src/domain/UBGraphicsPolygonItem.cpp b/src/domain/UBGraphicsPolygonItem.cpp index 57668191..20da378c 100644 --- a/src/domain/UBGraphicsPolygonItem.cpp +++ b/src/domain/UBGraphicsPolygonItem.cpp @@ -3,7 +3,10 @@ #include "frameworks/UBGeometryUtils.h" #include "UBGraphicsScene.h" +#include "domain/UBGraphicsPolygonItem.h" +#include "domain/UBGraphicsStroke.h" +#include "core/memcheck.h" UBGraphicsPolygonItem::UBGraphicsPolygonItem (QGraphicsItem * parent) : QGraphicsPolygonItem(parent) @@ -39,7 +42,15 @@ UBGraphicsPolygonItem::UBGraphicsPolygonItem (const QLineF& pLine, qreal pWidth) UBGraphicsPolygonItem::~UBGraphicsPolygonItem() { - // NOOP + if (mStroke!=NULL) + { + QList pp = mStroke->polygons(); + int n = pp.indexOf(this); + if (n>=0) + pp.removeAt(n); + if (pp.empty()) + delete mStroke; + } } diff --git a/src/domain/UBGraphicsProxyWidget.cpp b/src/domain/UBGraphicsProxyWidget.cpp index 1bb8b6de..7bf33f47 100644 --- a/src/domain/UBGraphicsProxyWidget.cpp +++ b/src/domain/UBGraphicsProxyWidget.cpp @@ -14,6 +14,7 @@ #include "UBGraphicsDelegateFrame.h" +#include "core/memcheck.h" UBGraphicsProxyWidget::UBGraphicsProxyWidget(QGraphicsItem* parent) : QGraphicsProxyWidget(parent, Qt::FramelessWindowHint) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 31bd2934..f950f29c 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -23,6 +23,7 @@ #include "tools/UBGraphicsRuler.h" #include "tools/UBGraphicsProtractor.h" #include "tools/UBGraphicsCompass.h" +#include "tools/UBGraphicsTriangle.h" #include "tools/UBGraphicsCurtainItem.h" #include "document/UBDocumentProxy.h" @@ -46,6 +47,8 @@ #include "UBW3CWidget.h" #include "UBGraphicsStroke.h" +#include "core/memcheck.h" + qreal UBGraphicsScene::backgroundLayerStart = -20000000.0; qreal UBGraphicsScene::objectLayerStart = -10000000.0; qreal UBGraphicsScene::drawingLayerStart = 0.0; @@ -122,6 +125,7 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent) UBGraphicsScene::~UBGraphicsScene() { + int a = 13; // NOOP } @@ -1405,6 +1409,25 @@ void UBGraphicsScene::addProtractor(QPointF center) setModified(true); } +void UBGraphicsScene::addTriangle(QPointF center) +{ + // Protractor +/* + UBGraphicsTriangle* protractor = new UBGraphicsTriangle(); // mem : owned and destroyed by the scene + mTools << triangle; + + triangle->setZValue(toolLayerStart + toolOffsetProtractor); + triangle->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Tool)); + + addItem(triangle); + + QPointF itemSceneCenter = triangle->sceneBoundingRect().center(); + triangle->moveBy(center.x() - itemSceneCenter.x(), center.y() - itemSceneCenter.y()); + + triangle->setVisible(true); + setModified(true);*/ +} + void UBGraphicsScene::addCompass(QPointF center) { diff --git a/src/domain/UBGraphicsScene.h b/src/domain/UBGraphicsScene.h index 3302a449..6b32fb2b 100644 --- a/src/domain/UBGraphicsScene.h +++ b/src/domain/UBGraphicsScene.h @@ -156,8 +156,10 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem qreal getNextObjectZIndex(); void addRuler(QPointF center); + void addTriangle(QPointF center); void addProtractor(QPointF center); void addCompass(QPointF center); + void addMask(); class SceneViewState diff --git a/src/domain/UBGraphicsStroke.cpp b/src/domain/UBGraphicsStroke.cpp index bda927ce..5141a47d 100644 --- a/src/domain/UBGraphicsStroke.cpp +++ b/src/domain/UBGraphicsStroke.cpp @@ -9,6 +9,7 @@ #include "UBGraphicsPolygonItem.h" +#include "core/memcheck.h" UBGraphicsStroke::UBGraphicsStroke() { diff --git a/src/domain/UBGraphicsSvgItem.cpp b/src/domain/UBGraphicsSvgItem.cpp index 4026c838..4a29bb26 100644 --- a/src/domain/UBGraphicsSvgItem.cpp +++ b/src/domain/UBGraphicsSvgItem.cpp @@ -13,6 +13,7 @@ #include "UBGraphicsItemDelegate.h" #include "UBGraphicsPixmapItem.h" +#include "core/memcheck.h" UBGraphicsSvgItem::UBGraphicsSvgItem(const QString& pFilePath, QGraphicsItem* parent) : QGraphicsSvgItem(pFilePath, parent) diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index 182bea59..1b3c2d4b 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -16,6 +16,7 @@ #include "board/UBBoardView.h" #include "core/UBSettings.h" +#include "core/memcheck.h" QColor UBGraphicsTextItem::lastUsedTextColor; diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index 1db3b905..4e493c86 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -18,6 +18,7 @@ #include "core/UBApplicationController.h" // TODO UB 4.x clean that dependency #include "core/UBDisplayManager.h" // TODO UB 4.x clean that dependency +#include "core/memcheck.h" const int UBGraphicsTextItemDelegate::sMinPixelSize = 8; diff --git a/src/domain/UBGraphicsTextItemUndoCommand.cpp b/src/domain/UBGraphicsTextItemUndoCommand.cpp index 1b7e11f0..06a2980b 100644 --- a/src/domain/UBGraphicsTextItemUndoCommand.cpp +++ b/src/domain/UBGraphicsTextItemUndoCommand.cpp @@ -8,6 +8,7 @@ #include "UBGraphicsTextItemUndoCommand.h" #include "UBGraphicsTextItem.h" +#include "core/memcheck.h" UBGraphicsTextItemUndoCommand::UBGraphicsTextItemUndoCommand(UBGraphicsTextItem *textItem) : mTextItem(textItem) diff --git a/src/domain/UBGraphicsVideoItem.cpp b/src/domain/UBGraphicsVideoItem.cpp index 526c7b8e..4028aa43 100644 --- a/src/domain/UBGraphicsVideoItem.cpp +++ b/src/domain/UBGraphicsVideoItem.cpp @@ -2,6 +2,7 @@ #include "UBGraphicsVideoItemDelegate.h" #include "UBGraphicsDelegateFrame.h" +#include "core/memcheck.h" UBGraphicsVideoItem::UBGraphicsVideoItem(const QUrl& pVideoFileUrl, QGraphicsItem *parent): UBGraphicsMediaItem(pVideoFileUrl,parent) diff --git a/src/domain/UBGraphicsVideoItemDelegate.cpp b/src/domain/UBGraphicsVideoItemDelegate.cpp index 73294c4c..035df0e3 100644 --- a/src/domain/UBGraphicsVideoItemDelegate.cpp +++ b/src/domain/UBGraphicsVideoItemDelegate.cpp @@ -21,7 +21,7 @@ #include "domain/UBGraphicsVideoItem.h" #include "domain/UBGraphicsDelegateFrame.h" - +#include "core/memcheck.h" UBGraphicsVideoItemDelegate::UBGraphicsVideoItemDelegate(UBGraphicsVideoItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent) : UBGraphicsItemDelegate(pDelegated, parent, true, false) diff --git a/src/domain/UBGraphicsWidgetItem.cpp b/src/domain/UBGraphicsWidgetItem.cpp index 8e27a4ec..e7fbcc8e 100644 --- a/src/domain/UBGraphicsWidgetItem.cpp +++ b/src/domain/UBGraphicsWidgetItem.cpp @@ -11,6 +11,8 @@ #include "UBGraphicsScene.h" #include "UBAppleWidget.h" +#include "core/memcheck.h" + UBGraphicsWidgetItem::UBGraphicsWidgetItem(QGraphicsItem *parent, int widgetType) : UBGraphicsProxyWidget(parent) , mWebKitWidget(0) diff --git a/src/domain/UBGraphicsWidgetItemDelegate.cpp b/src/domain/UBGraphicsWidgetItemDelegate.cpp index 740bf4df..1f83be7f 100644 --- a/src/domain/UBGraphicsWidgetItemDelegate.cpp +++ b/src/domain/UBGraphicsWidgetItemDelegate.cpp @@ -22,6 +22,7 @@ #include "domain/UBGraphicsWidgetItem.h" #include "domain/UBGraphicsDelegateFrame.h" +#include "core/memcheck.h" UBGraphicsWidgetItemDelegate::UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType) : UBGraphicsItemDelegate(pDelegated, 0, true, false) diff --git a/src/domain/UBItem.cpp b/src/domain/UBItem.cpp index b9f6129a..7d66d803 100644 --- a/src/domain/UBItem.cpp +++ b/src/domain/UBItem.cpp @@ -1,5 +1,7 @@ #include "UBItem.h" +#include "core/memcheck.h" + UBItem::UBItem() : mUuid(QUuid::createUuid()) , mRenderingQuality(UBItem::RenderingQualityNormal) diff --git a/src/domain/UBPageSizeUndoCommand.cpp b/src/domain/UBPageSizeUndoCommand.cpp index daf1ab8e..11c1bc97 100644 --- a/src/domain/UBPageSizeUndoCommand.cpp +++ b/src/domain/UBPageSizeUndoCommand.cpp @@ -13,6 +13,7 @@ #include "board/UBBoardController.h" #include "UBGraphicsScene.h" +#include "core/memcheck.h" UBPageSizeUndoCommand::UBPageSizeUndoCommand(UBGraphicsScene* pScene, const QSize& previousSize, const QSize& newSize) : mScene(pScene) diff --git a/src/domain/UBResizableGraphicsItem.cpp b/src/domain/UBResizableGraphicsItem.cpp index 0a79415f..2c66743e 100644 --- a/src/domain/UBResizableGraphicsItem.cpp +++ b/src/domain/UBResizableGraphicsItem.cpp @@ -7,6 +7,8 @@ #include "UBResizableGraphicsItem.h" +#include "core/memcheck.h" + UBResizableGraphicsItem::UBResizableGraphicsItem() { // NOOP diff --git a/src/domain/UBW3CWidget.cpp b/src/domain/UBW3CWidget.cpp index c83e77d9..4ca26cfb 100644 --- a/src/domain/UBW3CWidget.cpp +++ b/src/domain/UBW3CWidget.cpp @@ -21,6 +21,8 @@ #include "board/UBBoardController.h" +#include "core/memcheck.h" + bool UBW3CWidget::sTemplateLoaded = false; QMap UBW3CWidget::sNPAPIWrapperTemplates; QString UBW3CWidget::sNPAPIWrappperConfigTemplate; diff --git a/src/frameworks/UBBase32.cpp b/src/frameworks/UBBase32.cpp index 0a6c89bb..d83c6423 100644 --- a/src/frameworks/UBBase32.cpp +++ b/src/frameworks/UBBase32.cpp @@ -7,6 +7,8 @@ #include "UBBase32.h" +#include "core/memcheck.h" + QString UBBase32::sBase32Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; int UBBase32::sBase32Lookup[] = diff --git a/src/frameworks/UBCoreGraphicsScene.cpp b/src/frameworks/UBCoreGraphicsScene.cpp index d5bfb767..109bd002 100644 --- a/src/frameworks/UBCoreGraphicsScene.cpp +++ b/src/frameworks/UBCoreGraphicsScene.cpp @@ -7,9 +7,12 @@ #include "UBCoreGraphicsScene.h" +#include "core/memcheck.h" + UBCoreGraphicsScene::UBCoreGraphicsScene(QObject * parent) : QGraphicsScene ( parent ) { + int a = 13; //NOOP } @@ -18,7 +21,7 @@ UBCoreGraphicsScene::~UBCoreGraphicsScene() //we must delete removed items that are no more in any scene foreach (const QGraphicsItem* item, mItemsToDelete) { - if (!item->scene() && !(item->scene() == this)) + if (item->scene()==NULL || item->scene() == this) { delete item; } diff --git a/src/frameworks/UBCryptoUtils.cpp b/src/frameworks/UBCryptoUtils.cpp index 1ec63321..07234dd5 100644 --- a/src/frameworks/UBCryptoUtils.cpp +++ b/src/frameworks/UBCryptoUtils.cpp @@ -9,6 +9,8 @@ #include +#include "core/memcheck.h" + UBCryptoUtils* UBCryptoUtils::sInstance(0); QString UBCryptoUtils::sAESKey("9ecHaspud9uD9ste5erAchehefrup3echej-caje6&thestawacuk=h#F3jet3aF"); QString UBCryptoUtils::sAESSalt("6f0083e0-a90c-11de-ac21-0002a5d5c51b"); diff --git a/src/frameworks/UBDesktopServices_win.cpp b/src/frameworks/UBDesktopServices_win.cpp index f0782644..281080e7 100644 --- a/src/frameworks/UBDesktopServices_win.cpp +++ b/src/frameworks/UBDesktopServices_win.cpp @@ -1,5 +1,6 @@ #include "UBDesktopServices.h" +#include "core/memcheck.h" QString UBDesktopServices::storageLocation(StandardLocation type) { diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index b50935c5..b4f51b1f 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -14,6 +14,8 @@ #include +#include "core/memcheck.h" + QStringList UBFileSystemUtils::sTempDirToCleanUp; diff --git a/src/frameworks/UBGeometryUtils.cpp b/src/frameworks/UBGeometryUtils.cpp index 4c615f44..6b64f244 100644 --- a/src/frameworks/UBGeometryUtils.cpp +++ b/src/frameworks/UBGeometryUtils.cpp @@ -7,6 +7,8 @@ #include "UBGeometryUtils.h" +#include "core/memcheck.h" + const double PI = 4.0 * atan(1.0); UBGeometryUtils::UBGeometryUtils() diff --git a/src/frameworks/UBPlatformUtils.cpp b/src/frameworks/UBPlatformUtils.cpp index d4c92047..e010e0d2 100644 --- a/src/frameworks/UBPlatformUtils.cpp +++ b/src/frameworks/UBPlatformUtils.cpp @@ -1,10 +1,11 @@ #include "UBPlatformUtils.h" +#include "core/memcheck.h" void UBPlatformUtils::destroy() { - initializeKeyboardLayouts(); + destroyKeyboardLayouts(); } UBPlatformUtils::UBPlatformUtils() diff --git a/src/frameworks/UBPlatformUtils.h b/src/frameworks/UBPlatformUtils.h index 6fd59934..8e9d8963 100644 --- a/src/frameworks/UBPlatformUtils.h +++ b/src/frameworks/UBPlatformUtils.h @@ -77,6 +77,7 @@ class UBPlatformUtils virtual ~UBPlatformUtils(); static void initializeKeyboardLayouts(); + static void destroyKeyboardLayouts(); static int nKeyboardLayouts; static UBKeyboardLocale** keyboardLayouts; diff --git a/src/frameworks/UBPlatformUtils_linux.cpp b/src/frameworks/UBPlatformUtils_linux.cpp index 8f72dd48..a8242434 100644 --- a/src/frameworks/UBPlatformUtils_linux.cpp +++ b/src/frameworks/UBPlatformUtils_linux.cpp @@ -307,3 +307,11 @@ void UBPlatformUtils::initializeKeyboardLayouts() keyboardLayouts[2] = new UBKeyboardLocale("French", "fr", "", new QIcon(":/images/flags/fr.png"), FRENCH_LOCALE); keyboardLayouts[3] = new UBKeyboardLocale("German", "de", "", new QIcon(":/images/flags/de.png"), GERMAN_LOCALE); } + +void UBPlatformUtils::destroyKeyboardLayouts() +{ + for(int i=0; i<4; i++) + delete keyboardLayouts[i]; + delete [] keyboardLayouts; + keyboardLayouts = NULL; +} \ No newline at end of file diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index 1f2b33eb..828e0292 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -477,4 +477,5 @@ void UBPlatformUtils::initializeKeyboardLayouts() } - +void UBPlatformUtils::destroyKeyboardLayouts() +{} diff --git a/src/frameworks/UBPlatformUtils_win.cpp b/src/frameworks/UBPlatformUtils_win.cpp index c07c7944..b04f59cd 100644 --- a/src/frameworks/UBPlatformUtils_win.cpp +++ b/src/frameworks/UBPlatformUtils_win.cpp @@ -6,6 +6,8 @@ #include #include +#include "core/memcheck.h" + void UBPlatformUtils::init() { initializeKeyboardLayouts(); @@ -347,3 +349,10 @@ void UBPlatformUtils::initializeKeyboardLayouts() keyboardLayouts[3] = new UBKeyboardLocale("German", "de", "", new QIcon(":/images/flags/de.png"), GERMAN_LOCALE); } +void UBPlatformUtils::destroyKeyboardLayouts() +{ + for(int i=0; i<4; i++) + delete keyboardLayouts[i]; + delete [] keyboardLayouts; + keyboardLayouts = NULL; +} \ No newline at end of file diff --git a/src/frameworks/UBStringUtils.cpp b/src/frameworks/UBStringUtils.cpp index 7e2c792a..27bd2ef2 100644 --- a/src/frameworks/UBStringUtils.cpp +++ b/src/frameworks/UBStringUtils.cpp @@ -1,5 +1,6 @@ #include "UBStringUtils.h" +#include "core/memcheck.h" QStringList UBStringUtils::sortByLastDigit(const QStringList& sourceList) { diff --git a/src/frameworks/UBVersion.cpp b/src/frameworks/UBVersion.cpp index 1f403408..39910c6e 100644 --- a/src/frameworks/UBVersion.cpp +++ b/src/frameworks/UBVersion.cpp @@ -11,6 +11,9 @@ #include #include + +#include "core/memcheck.h" + UBVersion::UBVersion() : mIsValid(false) , mPlatform(-1) diff --git a/src/gui/UBActionPalette.cpp b/src/gui/UBActionPalette.cpp index bc93294a..56fb0400 100644 --- a/src/gui/UBActionPalette.cpp +++ b/src/gui/UBActionPalette.cpp @@ -7,6 +7,8 @@ #include "UBActionPalette.h" +#include "core/memcheck.h" + UBActionPalette::UBActionPalette(QList actions, Qt::Orientation orientation, QWidget * parent) : UBFloatingPalette(Qt::TopRightCorner, parent) { diff --git a/src/gui/UBBlackoutWidget.cpp b/src/gui/UBBlackoutWidget.cpp index 9e3aac3d..0d8b33ae 100644 --- a/src/gui/UBBlackoutWidget.cpp +++ b/src/gui/UBBlackoutWidget.cpp @@ -3,6 +3,7 @@ #include "UBBlackoutWidget.h" +#include "core/memcheck.h" UBBlackoutWidget::UBBlackoutWidget(QWidget *parent) : QWidget(parent) diff --git a/src/gui/UBCircleFrame.cpp b/src/gui/UBCircleFrame.cpp index 61cb0ae2..83780b91 100644 --- a/src/gui/UBCircleFrame.cpp +++ b/src/gui/UBCircleFrame.cpp @@ -6,6 +6,7 @@ */ #include "UBCircleFrame.h" +#include "core/memcheck.h" UBCircleFrame::UBCircleFrame(QWidget* parent) : QFrame(parent) diff --git a/src/gui/UBClockPalette.cpp b/src/gui/UBClockPalette.cpp index b2127f8c..8c90df5a 100644 --- a/src/gui/UBClockPalette.cpp +++ b/src/gui/UBClockPalette.cpp @@ -3,6 +3,7 @@ #include "UBClockPalette.h" +#include "core/memcheck.h" UBClockPalette::UBClockPalette(QWidget *parent) : UBFloatingPalette(Qt::TopRightCorner, parent) diff --git a/src/gui/UBColorPicker.cpp b/src/gui/UBColorPicker.cpp index cb481a3f..30fea9f6 100644 --- a/src/gui/UBColorPicker.cpp +++ b/src/gui/UBColorPicker.cpp @@ -9,6 +9,8 @@ #include +#include "core/memcheck.h" + UBColorPicker::UBColorPicker(QWidget* parent) : QFrame(parent) , mSelectedColorIndex(0) diff --git a/src/gui/UBDockPalette.cpp b/src/gui/UBDockPalette.cpp index 4f49d227..1e3d1a64 100644 --- a/src/gui/UBDockPalette.cpp +++ b/src/gui/UBDockPalette.cpp @@ -6,6 +6,8 @@ #include "core/UBSettings.h" #include "frameworks/UBPlatformUtils.h" +#include "core/memcheck.h" + /** * \brief The constructor */ diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index 7678ec28..534a3b4c 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -15,6 +15,8 @@ #include "document/UBDocumentController.h" #include "domain/UBGraphicsScene.h" +#include "core/memcheck.h" + /** * \brief Constructor * @param parent as the parent widget diff --git a/src/gui/UBDocumentThumbnailWidget.cpp b/src/gui/UBDocumentThumbnailWidget.cpp index 07ab63fc..675e1969 100644 --- a/src/gui/UBDocumentThumbnailWidget.cpp +++ b/src/gui/UBDocumentThumbnailWidget.cpp @@ -11,6 +11,8 @@ #include "core/UBMimeData.h" #include "core/UBSettings.h" +#include "core/memcheck.h" + UBDocumentThumbnailWidget::UBDocumentThumbnailWidget(QWidget* parent) : UBThumbnailWidget(parent) diff --git a/src/gui/UBDocumentToolsPalette.cpp b/src/gui/UBDocumentToolsPalette.cpp index c2edb2a6..023276fd 100644 --- a/src/gui/UBDocumentToolsPalette.cpp +++ b/src/gui/UBDocumentToolsPalette.cpp @@ -9,6 +9,8 @@ #include "gui/UBMainWindow.h" +#include "core/memcheck.h" + UBDocumentToolsPalette::UBDocumentToolsPalette(QWidget *parent) : UBActionPalette(Qt::TopRightCorner, parent) { diff --git a/src/gui/UBDocumentTreeWidget.cpp b/src/gui/UBDocumentTreeWidget.cpp index c878bde3..9fe9af46 100644 --- a/src/gui/UBDocumentTreeWidget.cpp +++ b/src/gui/UBDocumentTreeWidget.cpp @@ -17,6 +17,7 @@ #include "core/UBDocumentManager.h" #include "document/UBDocumentController.h" +#include "core/memcheck.h" UBDocumentTreeWidget::UBDocumentTreeWidget(QWidget * parent) : QTreeWidget(parent) diff --git a/src/gui/UBFavoriteToolPalette.cpp b/src/gui/UBFavoriteToolPalette.cpp index 3fc09f13..d2cd0fcd 100644 --- a/src/gui/UBFavoriteToolPalette.cpp +++ b/src/gui/UBFavoriteToolPalette.cpp @@ -17,6 +17,7 @@ #include "gui/UBMainWindow.h" +#include "core/memcheck.h" UBFavoriteToolPalette::UBFavoriteToolPalette(QWidget* parent) : UBActionPalette(Qt::Horizontal, parent) diff --git a/src/gui/UBFloatingPalette.cpp b/src/gui/UBFloatingPalette.cpp index 23751ab5..9171a0f4 100644 --- a/src/gui/UBFloatingPalette.cpp +++ b/src/gui/UBFloatingPalette.cpp @@ -8,6 +8,7 @@ #include "core/UBSettings.h" +#include "core/memcheck.h" UBFloatingPalette::UBFloatingPalette(Qt::Corner position, QWidget *parent) : QWidget(parent, parent ? Qt::Widget : Qt::Tool | (Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint)) diff --git a/src/gui/UBIconButton.cpp b/src/gui/UBIconButton.cpp index f0469fc7..84e01efe 100644 --- a/src/gui/UBIconButton.cpp +++ b/src/gui/UBIconButton.cpp @@ -3,6 +3,9 @@ #include "UBIconButton.h" +#include "core/memcheck.h" + + UBIconButton::UBIconButton(QWidget *parent, const QIcon &icon) : QAbstractButton(parent) , mToggleable(false) diff --git a/src/gui/UBKeyboardPalette.cpp b/src/gui/UBKeyboardPalette.cpp index 03705ab7..8b0e37a7 100644 --- a/src/gui/UBKeyboardPalette.cpp +++ b/src/gui/UBKeyboardPalette.cpp @@ -12,6 +12,9 @@ #include "UBKeyboardPalette.h" #include "core/UBSettings.h" + +#include "core/memcheck.h" + /* UBKeyboardPalette diff --git a/src/gui/UBKeyboardPalette_win.cpp b/src/gui/UBKeyboardPalette_win.cpp index 5b5da1e3..37272950 100644 --- a/src/gui/UBKeyboardPalette_win.cpp +++ b/src/gui/UBKeyboardPalette_win.cpp @@ -6,6 +6,8 @@ #include "../core/UBApplication.h" #include "../gui/UBMainWindow.h" +#include "core/memcheck.h" + void UBKeyboardButton::sendUnicodeSymbol(unsigned int nSymbol1, unsigned int nSymbol2, bool shift) { unsigned int nSymbol = shift? nSymbol2 : nSymbol1; diff --git a/src/gui/UBLibActionBar.cpp b/src/gui/UBLibActionBar.cpp index cf874ff9..829b9452 100644 --- a/src/gui/UBLibActionBar.cpp +++ b/src/gui/UBLibActionBar.cpp @@ -6,6 +6,7 @@ #include "core/UBApplication.h" #include "board/UBBoardController.h" +#include "core/memcheck.h" /** * \brief Constructor diff --git a/src/gui/UBLibItemProperties.cpp b/src/gui/UBLibItemProperties.cpp index 2c8b5069..9cb0c7b3 100644 --- a/src/gui/UBLibItemProperties.cpp +++ b/src/gui/UBLibItemProperties.cpp @@ -6,6 +6,9 @@ #include "frameworks/UBFileSystemUtils.h" + +#include "core/memcheck.h" + /** * \brief Constructor * @param parent as the parent widget @@ -132,11 +135,11 @@ UBLibItemProperties::~UBLibItemProperties() delete mpLayout; mpLayout = NULL; } - if(NULL != mpButtonLayout) - { - delete mpButtonLayout; - mpButtonLayout = NULL; - } + //if(NULL != mpButtonLayout) + //{ + // delete mpButtonLayout; + // mpButtonLayout = NULL; + //} if(NULL != mpSetAsBackgroundButton) { delete mpSetAsBackgroundButton; diff --git a/src/gui/UBLibNavigatorWidget.cpp b/src/gui/UBLibNavigatorWidget.cpp index a1c11941..8f8969a5 100644 --- a/src/gui/UBLibNavigatorWidget.cpp +++ b/src/gui/UBLibNavigatorWidget.cpp @@ -1,6 +1,8 @@ #include "UBLibNavigatorWidget.h" #include "UBLibPalette.h" +#include "core/memcheck.h" + static int lowBoundForSlider = 40; static int topBoundForSlider = 120; static int tickIntervalForSlider = 10; @@ -67,16 +69,16 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW */ UBLibNavigatorWidget::~UBLibNavigatorWidget() { - if(NULL != mLayout) - { - delete mLayout; - mLayout = NULL; - } - if(NULL != mLibWidget) - { - delete mLibWidget; - mLibWidget = NULL; - } + //if(NULL != mLayout) + //{ + // delete mLayout; + // mLayout = NULL; + //} + //if(NULL != mLibWidget) + //{ + // delete mLibWidget; + // mLibWidget = NULL; + //} if(NULL != mPathViewer) { delete mPathViewer; diff --git a/src/gui/UBLibPalette.cpp b/src/gui/UBLibPalette.cpp index 87485db5..f4bb447a 100644 --- a/src/gui/UBLibPalette.cpp +++ b/src/gui/UBLibPalette.cpp @@ -1,6 +1,8 @@ #include #include "UBLibPalette.h" +#include "core/memcheck.h" + /** * \brief Constructor * @param parent as the parent widget @@ -53,17 +55,18 @@ UBLibPalette::UBLibPalette(QWidget *parent, const char *name):UBDockPalette(pare */ UBLibPalette::~UBLibPalette() { - if(NULL != mStackedWidget) - { - delete mStackedWidget; - mStackedWidget = NULL; - } - if(NULL != mNavigator) - { - delete mNavigator; - mNavigator = NULL; - } - if(NULL != mProperties) + //if(NULL != mStackedWidget) + //{ + // delete mStackedWidget; + // mStackedWidget = NULL; + //} + //if(NULL != mNavigator) + //{ + // delete mNavigator; + // mNavigator = NULL; + //} + + if(NULL != mProperties) { delete mProperties; mProperties = NULL; @@ -78,11 +81,11 @@ UBLibPalette::~UBLibPalette() delete mDropWidget; mDropWidget = NULL; } - if(NULL != mLayout) - { - delete mLayout; - mLayout = NULL; - } + //if(NULL != mLayout) + //{ + //delete mLayout; + //mLayout = NULL; + //} } /** diff --git a/src/gui/UBLibPathViewer.cpp b/src/gui/UBLibPathViewer.cpp index d7302433..97c72692 100644 --- a/src/gui/UBLibPathViewer.cpp +++ b/src/gui/UBLibPathViewer.cpp @@ -6,6 +6,8 @@ #include "core/UBApplication.h" #include "board/UBBoardController.h" +#include "core/memcheck.h" + /** * \brief Constructor * @param parent as the parent widget @@ -47,11 +49,11 @@ UBLibPathViewer::~UBLibPathViewer() delete mpContainer; mpContainer = NULL; } - if(NULL != mpLayout) - { - delete mpLayout; - mpLayout = NULL; - } + //if(NULL != mpLayout) + //{ + // delete mpLayout; + // mpLayout = NULL; + //} if(NULL != mpElems) { delete mpElems; diff --git a/src/gui/UBLibraryWidget.cpp b/src/gui/UBLibraryWidget.cpp index ba60fc1a..cf44f3cf 100644 --- a/src/gui/UBLibraryWidget.cpp +++ b/src/gui/UBLibraryWidget.cpp @@ -9,6 +9,8 @@ #include "board/UBBoardController.h" #include "board/UBLibraryController.h" +#include "core/memcheck.h" + /** * \brief Constructor * @param parent as the parent widget @@ -30,21 +32,21 @@ UBLibraryWidget::UBLibraryWidget(QWidget *parent, const char *name):UBThumbnailW */ UBLibraryWidget::~UBLibraryWidget() { - if(NULL != chainedElements) - { - delete chainedElements; - chainedElements = NULL; - } - if(NULL != mpCrntDir) - { - delete mpCrntDir; - mpCrntDir = NULL; - } - if(NULL != mpCrntElem) - { - delete mpCrntElem; - mpCrntElem = NULL; - } + //if(NULL != chainedElements) + //{ + // delete chainedElements; + // chainedElements = NULL; + //} + //if(NULL != mpCrntDir) + //{ + // delete mpCrntDir; + // mpCrntDir = NULL; + //} + //if(NULL != mpCrntElem) + //{ + // delete mpCrntElem; + // mpCrntElem = NULL; + //} } /** diff --git a/src/gui/UBMainWindow.cpp b/src/gui/UBMainWindow.cpp index 09f503e1..e7c4b728 100644 --- a/src/gui/UBMainWindow.cpp +++ b/src/gui/UBMainWindow.cpp @@ -7,6 +7,7 @@ #include "core/UBApplicationController.h" #include "board/UBBoardController.h" +#include "core/memcheck.h" UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) diff --git a/src/gui/UBMessageWindow.cpp b/src/gui/UBMessageWindow.cpp index ba2de531..515ec645 100644 --- a/src/gui/UBMessageWindow.cpp +++ b/src/gui/UBMessageWindow.cpp @@ -9,6 +9,8 @@ #include "UBSpinningWheel.h" +#include "core/memcheck.h" + UBMessageWindow::UBMessageWindow(QWidget *parent) : UBFloatingPalette(Qt::BottomLeftCorner, parent) , mTimerID(-1) diff --git a/src/gui/UBMousePressFilter.cpp b/src/gui/UBMousePressFilter.cpp index bd3b0cda..ef479a1a 100644 --- a/src/gui/UBMousePressFilter.cpp +++ b/src/gui/UBMousePressFilter.cpp @@ -7,6 +7,8 @@ #include "UBMousePressFilter.h" +#include "core/memcheck.h" + UBMousePressFilter::UBMousePressFilter(QObject* parent) : QObject(parent) , mPendingEvent(0) diff --git a/src/gui/UBNavigatorPalette.cpp b/src/gui/UBNavigatorPalette.cpp index 958f5676..6c9974a5 100644 --- a/src/gui/UBNavigatorPalette.cpp +++ b/src/gui/UBNavigatorPalette.cpp @@ -2,6 +2,8 @@ #include "core/UBApplication.h" #include "board/UBBoardController.h" +#include "core/memcheck.h" + /** * \brief Constructor * @param parent as the parent widget diff --git a/src/gui/UBPageNumberPalette.cpp b/src/gui/UBPageNumberPalette.cpp index 0d0f07ed..b8aab14e 100644 --- a/src/gui/UBPageNumberPalette.cpp +++ b/src/gui/UBPageNumberPalette.cpp @@ -3,6 +3,8 @@ #include "UBPageNumberPalette.h" +#include "core/memcheck.h" + UBPageNumberPalette::UBPageNumberPalette(QWidget *parent) : UBFloatingPalette(Qt::BottomRightCorner, parent) { diff --git a/src/gui/UBPropertyPalette.cpp b/src/gui/UBPropertyPalette.cpp index 4ad335d8..19791d44 100644 --- a/src/gui/UBPropertyPalette.cpp +++ b/src/gui/UBPropertyPalette.cpp @@ -1,5 +1,7 @@ #include "UBPropertyPalette.h" +#include "core/memcheck.h" + /** * \brief Constructor * @param parent as the parent widget diff --git a/src/gui/UBResources.cpp b/src/gui/UBResources.cpp index 0ec5770f..81d10263 100644 --- a/src/gui/UBResources.cpp +++ b/src/gui/UBResources.cpp @@ -5,6 +5,8 @@ #include "core/UBApplication.h" +#include "core/memcheck.h" + UBResources* UBResources::sSingleton = 0; UBResources::UBResources(QObject* pParent) diff --git a/src/gui/UBRubberBand.cpp b/src/gui/UBRubberBand.cpp index ef6be1c4..66df5435 100644 --- a/src/gui/UBRubberBand.cpp +++ b/src/gui/UBRubberBand.cpp @@ -13,6 +13,8 @@ #include #endif +#include "core/memcheck.h" + UBRubberBand::UBRubberBand(Shape s, QWidget * p) : QRubberBand(s, p) { diff --git a/src/gui/UBScreenMirror.cpp b/src/gui/UBScreenMirror.cpp index bbab66f3..81c1030d 100644 --- a/src/gui/UBScreenMirror.cpp +++ b/src/gui/UBScreenMirror.cpp @@ -11,6 +11,8 @@ #include "core/UBSetting.h" #include "core/UBApplication.h" +#include "core/memcheck.h" + UBScreenMirror::UBScreenMirror(QWidget* parent) : QWidget(parent) , mScreenIndex(0) diff --git a/src/gui/UBSpinningWheel.cpp b/src/gui/UBSpinningWheel.cpp index b218ec6e..059e8ec0 100644 --- a/src/gui/UBSpinningWheel.cpp +++ b/src/gui/UBSpinningWheel.cpp @@ -3,6 +3,8 @@ #include +#include "core/memcheck.h" + UBSpinningWheel::UBSpinningWheel(QWidget *parent) : QWidget(parent) , mPosition(9) diff --git a/src/gui/UBStylusPalette.cpp b/src/gui/UBStylusPalette.cpp index a837f081..344720be 100644 --- a/src/gui/UBStylusPalette.cpp +++ b/src/gui/UBStylusPalette.cpp @@ -13,6 +13,8 @@ #include "frameworks/UBPlatformUtils.h" +#include "core/memcheck.h" + UBStylusPalette::UBStylusPalette(QWidget *parent, Qt::Orientation orient) : UBActionPalette(Qt::TopLeftCorner, parent, orient) , mLastSelectedId(-1) diff --git a/src/gui/UBThumbnailView.cpp b/src/gui/UBThumbnailView.cpp index 2e6dc678..591cc1f2 100644 --- a/src/gui/UBThumbnailView.cpp +++ b/src/gui/UBThumbnailView.cpp @@ -4,6 +4,7 @@ #include "core/UBMimeData.h" +#include "core/memcheck.h" UBThumbnailView::UBThumbnailView() { diff --git a/src/gui/UBThumbnailWidget.cpp b/src/gui/UBThumbnailWidget.cpp index 765e99a0..2a81ac45 100644 --- a/src/gui/UBThumbnailWidget.cpp +++ b/src/gui/UBThumbnailWidget.cpp @@ -11,6 +11,8 @@ #include "core/UBSettings.h" +#include "core/memcheck.h" + UBThumbnailWidget::UBThumbnailWidget(QWidget* parent) : QGraphicsView(parent) , mThumbnailWidth(UBSettings::defaultThumbnailWidth) diff --git a/src/gui/UBToolWidget.cpp b/src/gui/UBToolWidget.cpp index 48e91ffa..539d8b66 100644 --- a/src/gui/UBToolWidget.cpp +++ b/src/gui/UBToolWidget.cpp @@ -27,6 +27,8 @@ #include "board/UBBoardController.h" #include "board/UBBoardView.h" +#include "core/memcheck.h" + QPixmap* UBToolWidget::sClosePixmap = 0; QPixmap* UBToolWidget::sUnpinPixmap = 0; diff --git a/src/gui/UBToolbarButtonGroup.cpp b/src/gui/UBToolbarButtonGroup.cpp index 83c12793..02fc0e84 100644 --- a/src/gui/UBToolbarButtonGroup.cpp +++ b/src/gui/UBToolbarButtonGroup.cpp @@ -7,6 +7,8 @@ #include "board/UBDrawingController.h" +#include "core/memcheck.h" + UBToolbarButtonGroup::UBToolbarButtonGroup(QToolBar *toolBar, const QList &actions) : QWidget(toolBar) , mActions(actions) diff --git a/src/gui/UBUpdateDlg.cpp b/src/gui/UBUpdateDlg.cpp index 397a2893..d276a852 100644 --- a/src/gui/UBUpdateDlg.cpp +++ b/src/gui/UBUpdateDlg.cpp @@ -3,6 +3,8 @@ #include "UBUpdateDlg.h" +#include "core/memcheck.h" + UBUpdateDlg::UBUpdateDlg(QWidget *parent, int nbFiles, const QString& bkpPath) : QDialog(parent) , mpDlgBttn(NULL) diff --git a/src/gui/UBVideoPlayer.cpp b/src/gui/UBVideoPlayer.cpp index 6676c24a..79049801 100644 --- a/src/gui/UBVideoPlayer.cpp +++ b/src/gui/UBVideoPlayer.cpp @@ -13,6 +13,8 @@ #include #include +#include "core/memcheck.h" + UBVideoPlayer::UBVideoPlayer(QWidget* pParent) : QWidget(pParent) , mVideoPlayer(0) diff --git a/src/gui/UBWebToolsPalette.cpp b/src/gui/UBWebToolsPalette.cpp index bee96a71..eef6596e 100644 --- a/src/gui/UBWebToolsPalette.cpp +++ b/src/gui/UBWebToolsPalette.cpp @@ -14,6 +14,8 @@ #include "UBResources.h" #include "UBIconButton.h" +#include "core/memcheck.h" + UBWebToolsPalette::UBWebToolsPalette(QWidget *parent,bool tutorialMode=false) : UBActionPalette(Qt::TopRightCorner, parent) { diff --git a/src/gui/UBWidgetMirror.cpp b/src/gui/UBWidgetMirror.cpp index 12b35daa..ddfb9405 100644 --- a/src/gui/UBWidgetMirror.cpp +++ b/src/gui/UBWidgetMirror.cpp @@ -7,6 +7,8 @@ #include "UBWidgetMirror.h" +#include "core/memcheck.h" + UBWidgetMirror::UBWidgetMirror(QWidget* sourceWidget, QWidget* parent) : QWidget(parent, 0) , mSourceWidget(sourceWidget) diff --git a/src/gui/UBZoomPalette.cpp b/src/gui/UBZoomPalette.cpp index 77cb4ec5..e3e03273 100644 --- a/src/gui/UBZoomPalette.cpp +++ b/src/gui/UBZoomPalette.cpp @@ -15,6 +15,7 @@ #include "board/UBBoardController.h" #include "board/UBBoardView.h" +#include "core/memcheck.h" UBZoomPalette::UBZoomPalette(QWidget* parent) : UBFloatingPalette(Qt::BottomRightCorner, parent) diff --git a/src/network/UBAutoSaver.cpp b/src/network/UBAutoSaver.cpp index cbe8f823..0edf3a7a 100644 --- a/src/network/UBAutoSaver.cpp +++ b/src/network/UBAutoSaver.cpp @@ -43,6 +43,7 @@ #include +#include "core/memcheck.h" #define AUTOSAVE_IN 1000 * 3 // seconds #define MAXWAIT 1000 * 15 // seconds diff --git a/src/network/UBCookieJar.cpp b/src/network/UBCookieJar.cpp index d5f42274..f976080b 100644 --- a/src/network/UBCookieJar.cpp +++ b/src/network/UBCookieJar.cpp @@ -48,6 +48,7 @@ #include #include +#include "core/memcheck.h" static const unsigned int JAR_VERSION = 23; diff --git a/src/network/UBHttpFileDownloader.cpp b/src/network/UBHttpFileDownloader.cpp index c50eac78..1d332f48 100644 --- a/src/network/UBHttpFileDownloader.cpp +++ b/src/network/UBHttpFileDownloader.cpp @@ -9,6 +9,7 @@ #include "network/UBNetworkAccessManager.h" +#include "core/memcheck.h" UBHttpFileDownloader::UBHttpFileDownloader(QObject *parent) : QObject(parent) diff --git a/src/network/UBHttpGet.cpp b/src/network/UBHttpGet.cpp index f9904735..0c5e140c 100644 --- a/src/network/UBHttpGet.cpp +++ b/src/network/UBHttpGet.cpp @@ -11,6 +11,7 @@ #include "network/UBNetworkAccessManager.h" +#include "core/memcheck.h" UBHttpGet::UBHttpGet(QObject* parent) : QObject(parent) diff --git a/src/network/UBNetworkAccessManager.cpp b/src/network/UBNetworkAccessManager.cpp index 4b3dc47f..a1aef846 100644 --- a/src/network/UBNetworkAccessManager.cpp +++ b/src/network/UBNetworkAccessManager.cpp @@ -14,6 +14,8 @@ #include "UBCookieJar.h" +#include "core/memcheck.h" + UBNetworkAccessManager *UBNetworkAccessManager::sNetworkAccessManager = 0; UBNetworkAccessManager *UBNetworkAccessManager::defaultAccessManager() diff --git a/src/network/UBServerXMLHttpRequest.cpp b/src/network/UBServerXMLHttpRequest.cpp index 59140060..f58176a4 100644 --- a/src/network/UBServerXMLHttpRequest.cpp +++ b/src/network/UBServerXMLHttpRequest.cpp @@ -12,6 +12,7 @@ #include "network/UBNetworkAccessManager.h" +#include "core/memcheck.h" UBServerXMLHttpRequest::UBServerXMLHttpRequest(UBNetworkAccessManager* pNam, const QString& contentType) : QObject(pNam) diff --git a/src/pdf/GraphicsPDFItem.cpp b/src/pdf/GraphicsPDFItem.cpp index 1266c103..ebb4fabb 100644 --- a/src/pdf/GraphicsPDFItem.cpp +++ b/src/pdf/GraphicsPDFItem.cpp @@ -5,6 +5,8 @@ #include +#include "core/memcheck.h" + GraphicsPDFItem::GraphicsPDFItem(PDFRenderer *renderer, int pageNumber, QGraphicsItem *parentItem) : QObject(0), QGraphicsItem(parentItem) , mRenderer(renderer) diff --git a/src/pdf/PDFRenderer.cpp b/src/pdf/PDFRenderer.cpp index 9d78ed72..4a2a19a7 100644 --- a/src/pdf/PDFRenderer.cpp +++ b/src/pdf/PDFRenderer.cpp @@ -6,6 +6,8 @@ #include "XPDFRenderer.h" +#include "core/memcheck.h" + QMap< QUuid, QPointer > PDFRenderer::sRenderers; diff --git a/src/pdf/UBWebPluginPDFWidget.cpp b/src/pdf/UBWebPluginPDFWidget.cpp index 75981b82..b5a7ec48 100644 --- a/src/pdf/UBWebPluginPDFWidget.cpp +++ b/src/pdf/UBWebPluginPDFWidget.cpp @@ -4,6 +4,9 @@ #include "UBWebPluginPDFWidget.h" #include "XPDFRenderer.h" + +#include "core/memcheck.h" + UBWebPluginPDFWidget::UBWebPluginPDFWidget(const QUrl &url, QWidget *parent) : UBWebPluginWidget(url, parent) , mPreviousPageButton(this) diff --git a/src/pdf/XPDFRenderer.cpp b/src/pdf/XPDFRenderer.cpp index 893a8d0d..56b74ca9 100644 --- a/src/pdf/XPDFRenderer.cpp +++ b/src/pdf/XPDFRenderer.cpp @@ -11,6 +11,9 @@ #include #include + +#include "core/memcheck.h" + QAtomicInt XPDFRenderer::sInstancesCount = 0; XPDFRenderer::XPDFRenderer(const QString &filename) diff --git a/src/tools/UBAbstractDrawRuler.cpp b/src/tools/UBAbstractDrawRuler.cpp index 906895b6..b96d823b 100644 --- a/src/tools/UBAbstractDrawRuler.cpp +++ b/src/tools/UBAbstractDrawRuler.cpp @@ -1,6 +1,8 @@ #include "UBAbstractDrawRuler.h" +#include "core/memcheck.h" + UBAbstractDrawRuler::UBAbstractDrawRuler() {} diff --git a/src/tools/UBGraphicsCompass.cpp b/src/tools/UBGraphicsCompass.cpp index b45aa830..abfef034 100644 --- a/src/tools/UBGraphicsCompass.cpp +++ b/src/tools/UBGraphicsCompass.cpp @@ -16,6 +16,8 @@ #include "board/UBBoardController.h" // TODO UB 4.x clean that dependency #include "board/UBDrawingController.h" // TODO UB 4.x clean that dependency +#include "core/memcheck.h" + const QRect UBGraphicsCompass::sDefaultRect = QRect(0, -20, 300, 48); const QColor UBGraphicsCompass::sLightBackgroundMiddleFillColor = QColor(0x72, 0x72, 0x72, sFillTransparency); const QColor UBGraphicsCompass::sLightBackgroundEdgeFillColor = QColor(0xc3, 0xc3, 0xc3, sFillTransparency); diff --git a/src/tools/UBGraphicsCurtainItem.cpp b/src/tools/UBGraphicsCurtainItem.cpp index 94e046b9..5ece59bc 100644 --- a/src/tools/UBGraphicsCurtainItem.cpp +++ b/src/tools/UBGraphicsCurtainItem.cpp @@ -19,6 +19,8 @@ #include "board/UBBoardController.h" #include "board/UBBoardView.h" +#include "core/memcheck.h" + const QColor UBGraphicsCurtainItem::sDrawColor = Qt::white; const QColor UBGraphicsCurtainItem::sDarkBackgroundDrawColor = Qt::black; const QColor UBGraphicsCurtainItem::sOpaqueControlColor = QColor(191,191,191,255); diff --git a/src/tools/UBGraphicsCurtainItemDelegate.cpp b/src/tools/UBGraphicsCurtainItemDelegate.cpp index 40a11af4..9a6cdfed 100644 --- a/src/tools/UBGraphicsCurtainItemDelegate.cpp +++ b/src/tools/UBGraphicsCurtainItemDelegate.cpp @@ -14,6 +14,8 @@ #include "UBGraphicsCurtainItemDelegate.h" #include "UBGraphicsCurtainItem.h" +#include "core/memcheck.h" + UBGraphicsCurtainItemDelegate::UBGraphicsCurtainItemDelegate(UBGraphicsCurtainItem* pDelegated, QObject * parent) : UBGraphicsItemDelegate(pDelegated, parent, false) { diff --git a/src/tools/UBGraphicsProtractor.cpp b/src/tools/UBGraphicsProtractor.cpp index b34f0fab..206096d8 100644 --- a/src/tools/UBGraphicsProtractor.cpp +++ b/src/tools/UBGraphicsProtractor.cpp @@ -13,6 +13,8 @@ #include "board/UBBoardController.h" #include "board/UBDrawingController.h" +#include "core/memcheck.h" + const int UBGraphicsProtractor::sFillTransparency = 127; const int UBGraphicsProtractor::sDrawTransparency = 192; diff --git a/src/tools/UBGraphicsProtractor.h b/src/tools/UBGraphicsProtractor.h index c3c0458b..c6204b4c 100644 --- a/src/tools/UBGraphicsProtractor.h +++ b/src/tools/UBGraphicsProtractor.h @@ -25,12 +25,12 @@ class UBGraphicsProtractor : public QObject, public QGraphicsEllipseItem, public public: UBGraphicsProtractor (); - enum Tool {None, Move, Resize, Rotate, Reset, Close, MoveMarker}; + enum Tool {None, Move, Resize, Rotate, Reset, Close, MoveMarker}; - qreal angle () { return mStartAngle; } - qreal markerAngle () { return mCurrentAngle; } - void setAngle (qreal angle) { mStartAngle = angle; setStartAngle(mStartAngle * 16); } - void setMarkerAngle (qreal angle) { mCurrentAngle = angle; } + qreal angle () { return mStartAngle; } + qreal markerAngle () { return mCurrentAngle; } + void setAngle (qreal angle) { mStartAngle = angle; setStartAngle(mStartAngle * 16); } + void setMarkerAngle (qreal angle) { mCurrentAngle = angle; } virtual UBItem* deepCopy() const; @@ -46,14 +46,14 @@ class UBGraphicsProtractor : public QObject, public QGraphicsEllipseItem, public void hidden(); protected: - virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *styleOption, QWidget *widget); + virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *styleOption, QWidget *widget); virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); virtual void mousePressEvent (QGraphicsSceneMouseEvent *event); virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event); virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event); - virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event); + virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event); virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event); virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event); virtual QPainterPath shape() const; diff --git a/src/tools/UBGraphicsRuler.cpp b/src/tools/UBGraphicsRuler.cpp index 85fa5991..8d3b3d2a 100644 --- a/src/tools/UBGraphicsRuler.cpp +++ b/src/tools/UBGraphicsRuler.cpp @@ -15,6 +15,8 @@ #include "board/UBBoardController.h" // TODO UB 4.x clean that dependency #include "board/UBDrawingController.h" +#include "core/memcheck.h" + const QRect UBGraphicsRuler::sDefaultRect = QRect(0, 0, 800, 96); const QColor UBGraphicsRuler::sLightBackgroundMiddleFillColor = QColor(0x72, 0x72, 0x72, sFillTransparency); const QColor UBGraphicsRuler::sLightBackgroundEdgeFillColor = QColor(0xc3, 0xc3, 0xc3, sFillTransparency); @@ -201,6 +203,7 @@ void UBGraphicsRuler::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsRuler::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { + QObject* obj = new QObject(); UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool (); if (currentTool == UBStylusTool::Selector) diff --git a/src/tools/UBGraphicsTriangle.cpp b/src/tools/UBGraphicsTriangle.cpp new file mode 100644 index 00000000..5786abc0 --- /dev/null +++ b/src/tools/UBGraphicsTriangle.cpp @@ -0,0 +1,10 @@ + +#include "tools/UBGraphicsTriangle.h" +#include "core/memcheck.h" + +UBGraphicsTriangle::UBGraphicsTriangle() +{ +} + +UBGraphicsTriangle::~UBGraphicsTriangle() +{} \ No newline at end of file diff --git a/src/tools/UBGraphicsTriangle.h b/src/tools/UBGraphicsTriangle.h new file mode 100644 index 00000000..4705ebc4 --- /dev/null +++ b/src/tools/UBGraphicsTriangle.h @@ -0,0 +1,31 @@ + +/* + * UBGraphicsRuler.h + * + * Created on: April 16, 2009 + * Author: Jerome Marchaud + */ + +#ifndef UBGRAPHICSTRIANGLE_H_ +#define UBGRAPHICSTRIANGLE_H_ + +#include +#include +#include + +#include "core/UB.h" +#include "domain/UBItem.h" + + +class UBGraphicsScene; + +class UBGraphicsTriangle : public QObject, public QGraphicsPolygonItem, public UBItem +{ + Q_OBJECT; + + public: + UBGraphicsTriangle(); + virtual ~UBGraphicsTriangle(); +}; + +#endif /* UBGRAPHICSTRIANGLE_H_ */ diff --git a/src/tools/UBToolsManager.cpp b/src/tools/UBToolsManager.cpp index 7ae641f6..2de3d3bc 100644 --- a/src/tools/UBToolsManager.cpp +++ b/src/tools/UBToolsManager.cpp @@ -7,6 +7,8 @@ #include "UBToolsManager.h" +#include "core/memcheck.h" + UBToolsManager* UBToolsManager::sManager = 0; UBToolsManager::UBToolsManager(QObject *parent) @@ -41,6 +43,13 @@ UBToolsManager::UBToolsManager(QObject *parent) mToolsIcon.insert(protractor.id,":/images/toolPalette/protractorTool.png"); mDescriptors << protractor; + triangle.id = "uniboardTool://uniboard.mnemis.com/triangle"; + triangle.icon = QPixmap(":/images/toolPalette/triangleTool.png"); + triangle.label = tr("Triangle"); + triangle.version = "1.0"; + mToolsIcon.insert(triangle.id,":/images/toolPalette/triangleTool.png"); + mDescriptors << triangle; + } UBToolsManager::~UBToolsManager() diff --git a/src/tools/UBToolsManager.h b/src/tools/UBToolsManager.h index a60bf969..986c9dc2 100644 --- a/src/tools/UBToolsManager.h +++ b/src/tools/UBToolsManager.h @@ -69,6 +69,7 @@ class UBToolsManager : public QObject UBToolDescriptor protractor; UBToolDescriptor compass; UBToolDescriptor mask; + UBToolDescriptor triangle; QString iconFromToolId(QString id) { return mToolsIcon.value(id);} diff --git a/src/tools/tools.pri b/src/tools/tools.pri index 690a444b..a7247816 100644 --- a/src/tools/tools.pri +++ b/src/tools/tools.pri @@ -1,5 +1,6 @@ HEADERS += src/tools/UBGraphicsRuler.h \ + src/tools/UBGraphicsTriangle.h \ src/tools/UBGraphicsProtractor.h \ src/tools/UBGraphicsCompass.h \ src/tools/UBToolsManager.h \ @@ -8,6 +9,7 @@ HEADERS += src/tools/UBGraphicsRuler.h \ src/tools/UBAbstractDrawRuler.h SOURCES += src/tools/UBGraphicsRuler.cpp \ + src/tools/UBGraphicsTriangle.cpp \ src/tools/UBGraphicsProtractor.cpp \ src/tools/UBGraphicsCompass.cpp \ src/tools/UBToolsManager.cpp \