diff --git a/resources/images/toolPalette/triangleTool.png b/resources/images/toolPalette/triangleTool.png
new file mode 100644
index 00000000..0421bcea
Binary files /dev/null and b/resources/images/toolPalette/triangleTool.png differ
diff --git a/resources/sankore.qrc b/resources/sankore.qrc
index 5f493b77..9ac47637 100644
--- a/resources/sankore.qrc
+++ b/resources/sankore.qrc
@@ -153,6 +153,7 @@
images/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 \