Memory leaks checking for Microsoft Visual Studio

preferencesAboutTextFull
Anatoly Mihalchenko 14 years ago
parent 086c49544a
commit c74e98bc59
  1. BIN
      resources/images/toolPalette/triangleTool.png
  2. 1
      resources/sankore.qrc
  3. 2
      src/adaptors/UBExportAdaptor.cpp
  4. 2
      src/adaptors/UBExportDocument.cpp
  5. 3
      src/adaptors/UBExportFullPDF.cpp
  6. 1
      src/adaptors/UBExportPDF.cpp
  7. 2
      src/adaptors/UBExportWeb.cpp
  8. 1
      src/adaptors/UBImportAdaptor.cpp
  9. 2
      src/adaptors/UBImportDocument.cpp
  10. 1
      src/adaptors/UBImportDocument.h
  11. 2
      src/adaptors/UBImportImage.cpp
  12. 1
      src/adaptors/UBImportImage.h
  13. 2
      src/adaptors/UBImportPDF.cpp
  14. 1
      src/adaptors/UBImportPDF.h
  15. 1
      src/adaptors/UBImportVirtualPrinter.cpp
  16. 2
      src/adaptors/UBIniFileParser.cpp
  17. 2
      src/adaptors/UBMetadataDcSubsetAdaptor.cpp
  18. 23
      src/adaptors/UBSvgSubsetAdaptor.cpp
  19. 2
      src/adaptors/UBThumbnailAdaptor.cpp
  20. 2
      src/adaptors/UBWebPublisher.cpp
  21. 2
      src/adaptors/publishing/UBAbstractPublisher.cpp
  22. 1
      src/adaptors/publishing/UBCapturePublisher.cpp
  23. 1
      src/adaptors/publishing/UBCapturePublisher.h
  24. 1
      src/adaptors/publishing/UBDocumentPublisher.cpp
  25. 2
      src/adaptors/publishing/UBSvgSubsetRasterizer.cpp
  26. 2
      src/adaptors/voting/UBAbstractVotingSystem.cpp
  27. 2
      src/adaptors/voting/UBReply2005VotingSystem.cpp
  28. 2
      src/adaptors/voting/UBReplyWRS970VotingSystem.cpp
  29. 2
      src/api/UBLibraryAPI.cpp
  30. 1
      src/api/UBW3CWidgetAPI.cpp
  31. 2
      src/api/UBWidgetMessageAPI.cpp
  32. 1
      src/api/UBWidgetMessageAPI.h
  33. 1
      src/api/UBWidgetUniboardAPI.cpp
  34. 1
      src/api/UBWidgetVotingSystemAPI.cpp
  35. 7
      src/board/UBBoardController.cpp
  36. 1
      src/board/UBBoardPaletteManager.cpp
  37. 2
      src/board/UBBoardView.cpp
  38. 2
      src/board/UBDrawingController.cpp
  39. 2
      src/board/UBLibraryController.cpp
  40. 18
      src/core/UB.h
  41. 26
      src/core/UBApplication.cpp
  42. 2
      src/core/UBApplication.h
  43. 6
      src/core/UBApplicationController.cpp
  44. 1
      src/core/UBDisplayManager.cpp
  45. 2
      src/core/UBDocumentManager.cpp
  46. 2
      src/core/UBIdleTimer.cpp
  47. 2
      src/core/UBMimeData.cpp
  48. 1
      src/core/UBPersistenceManager.cpp
  49. 4
      src/core/UBPreferencesController.cpp
  50. 1
      src/core/UBSceneCache.cpp
  51. 1
      src/core/UBSetting.cpp
  52. 2
      src/core/UBSettings.cpp
  53. 24
      src/core/main.cpp
  54. 2
      src/desktop/UBCustomCaptureWindow.cpp
  55. 4
      src/desktop/UBDesktopAnnotationController.cpp
  56. 3
      src/desktop/UBDesktopEraserPalette.cpp
  57. 2
      src/desktop/UBDesktopMarkerPalette.cpp
  58. 1
      src/desktop/UBDesktopPalette.cpp
  59. 2
      src/desktop/UBDesktopPenPalette.cpp
  60. 1
      src/desktop/UBDesktopToolsPalette.cpp
  61. 1
      src/desktop/UBWindowCaptureDelegate_win.cpp
  62. 2
      src/desktop/UBWindowCapture_win.cpp
  63. 1
      src/document/UBDocumentController.cpp
  64. 1
      src/document/UBDocumentProxy.cpp
  65. 1
      src/domain/UBAbstractWidget.cpp
  66. 1
      src/domain/UBAppleWidget.cpp
  67. 1
      src/domain/UBDocumentUndoCommand.cpp
  68. 1
      src/domain/UBGraphicsAudioItem.cpp
  69. 2
      src/domain/UBGraphicsAudioItemDelegate.cpp
  70. 2
      src/domain/UBGraphicsDelegateFrame.cpp
  71. 2
      src/domain/UBGraphicsItemDelegate.cpp
  72. 1
      src/domain/UBGraphicsItemTransformUndoCommand.cpp
  73. 2
      src/domain/UBGraphicsItemUndoCommand.cpp
  74. 2
      src/domain/UBGraphicsMediaItem.cpp
  75. 1
      src/domain/UBGraphicsPDFItem.cpp
  76. 2
      src/domain/UBGraphicsPixmapItem.cpp
  77. 13
      src/domain/UBGraphicsPolygonItem.cpp
  78. 1
      src/domain/UBGraphicsProxyWidget.cpp
  79. 23
      src/domain/UBGraphicsScene.cpp
  80. 2
      src/domain/UBGraphicsScene.h
  81. 1
      src/domain/UBGraphicsStroke.cpp
  82. 1
      src/domain/UBGraphicsSvgItem.cpp
  83. 1
      src/domain/UBGraphicsTextItem.cpp
  84. 1
      src/domain/UBGraphicsTextItemDelegate.cpp
  85. 1
      src/domain/UBGraphicsTextItemUndoCommand.cpp
  86. 1
      src/domain/UBGraphicsVideoItem.cpp
  87. 2
      src/domain/UBGraphicsVideoItemDelegate.cpp
  88. 2
      src/domain/UBGraphicsWidgetItem.cpp
  89. 1
      src/domain/UBGraphicsWidgetItemDelegate.cpp
  90. 2
      src/domain/UBItem.cpp
  91. 1
      src/domain/UBPageSizeUndoCommand.cpp
  92. 2
      src/domain/UBResizableGraphicsItem.cpp
  93. 2
      src/domain/UBW3CWidget.cpp
  94. 2
      src/frameworks/UBBase32.cpp
  95. 5
      src/frameworks/UBCoreGraphicsScene.cpp
  96. 2
      src/frameworks/UBCryptoUtils.cpp
  97. 1
      src/frameworks/UBDesktopServices_win.cpp
  98. 2
      src/frameworks/UBFileSystemUtils.cpp
  99. 2
      src/frameworks/UBGeometryUtils.cpp
  100. 3
      src/frameworks/UBPlatformUtils.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -153,6 +153,7 @@
<file>images/toolPalette/podcast.svg</file> <file>images/toolPalette/podcast.svg</file>
<file>images/toolPalette/podcastOn.svg</file> <file>images/toolPalette/podcastOn.svg</file>
<file>images/toolPalette/rulerTool.png</file> <file>images/toolPalette/rulerTool.png</file>
<file>images/toolPalette/triangleTool.png</file>
<file>images/toolPalette/protractorTool.png</file> <file>images/toolPalette/protractorTool.png</file>
<file>images/toolPalette/compassTool.png</file> <file>images/toolPalette/compassTool.png</file>
<file>images/toolPalette/maskTool.png</file> <file>images/toolPalette/maskTool.png</file>

@ -18,6 +18,8 @@
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "core/memcheck.h"
UBExportAdaptor::UBExportAdaptor(QObject *parent) UBExportAdaptor::UBExportAdaptor(QObject *parent)
: QObject(parent) : QObject(parent)
, mIsVerbose(true) , mIsVerbose(true)

@ -17,6 +17,8 @@
#include "quazip.h" #include "quazip.h"
#include "quazipfile.h" #include "quazipfile.h"
#include "core/memcheck.h"
UBExportDocument::UBExportDocument(QObject *parent) UBExportDocument::UBExportDocument(QObject *parent)
: UBExportAdaptor(parent) : UBExportAdaptor(parent)
{ {

@ -29,6 +29,9 @@
#include <Exception.h> #include <Exception.h>
#include <Transformation.h> #include <Transformation.h>
#include "core/memcheck.h"
using namespace merge_lib; using namespace merge_lib;

@ -22,6 +22,7 @@
#include "pdf/GraphicsPDFItem.h" #include "pdf/GraphicsPDFItem.h"
#include "core/memcheck.h"
UBExportPDF::UBExportPDF(QObject *parent) UBExportPDF::UBExportPDF(QObject *parent)
: UBExportAdaptor(parent) : UBExportAdaptor(parent)

@ -18,6 +18,8 @@
#include "quazip.h" #include "quazip.h"
#include "quazipfile.h" #include "quazipfile.h"
#include "core/memcheck.h"
UBExportWeb::UBExportWeb(QObject *parent) UBExportWeb::UBExportWeb(QObject *parent)
: UBExportAdaptor(parent) : UBExportAdaptor(parent)
{ {

@ -12,6 +12,7 @@
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "core/memcheck.h"
UBImportAdaptor::UBImportAdaptor(QObject *parent) UBImportAdaptor::UBImportAdaptor(QObject *parent)
:QObject(parent) :QObject(parent)

@ -19,6 +19,8 @@
#include "quazipfile.h" #include "quazipfile.h"
#include "quazipfileinfo.h" #include "quazipfileinfo.h"
#include "core/memcheck.h"
UBImportDocument::UBImportDocument(QObject *parent) UBImportDocument::UBImportDocument(QObject *parent)
:UBImportAdaptor(parent) :UBImportAdaptor(parent)
{ {

@ -10,6 +10,7 @@
#include <QtGui> #include <QtGui>
#include "UBImportAdaptor.h" #include "UBImportAdaptor.h"
class UBDocumentProxy; class UBDocumentProxy;
class UBImportDocument : public UBImportAdaptor class UBImportDocument : public UBImportAdaptor

@ -13,6 +13,8 @@
#include "pdf/PDFRenderer.h" #include "pdf/PDFRenderer.h"
#include "core/memcheck.h"
UBImportImage::UBImportImage(QObject *parent) UBImportImage::UBImportImage(QObject *parent)
: UBImportAdaptor(parent) : UBImportAdaptor(parent)
{ {

@ -4,6 +4,7 @@
#include <QtGui> #include <QtGui>
#include "UBImportAdaptor.h" #include "UBImportAdaptor.h"
class UBDocumentProxy; class UBDocumentProxy;
class UBImportImage : public UBImportAdaptor class UBImportImage : public UBImportAdaptor

@ -12,6 +12,8 @@
#include "pdf/PDFRenderer.h" #include "pdf/PDFRenderer.h"
#include "core/memcheck.h"
UBImportPDF::UBImportPDF(QObject *parent) UBImportPDF::UBImportPDF(QObject *parent)
: UBImportAdaptor(parent) : UBImportAdaptor(parent)
{ {

@ -4,6 +4,7 @@
#include <QtGui> #include <QtGui>
#include "UBImportAdaptor.h" #include "UBImportAdaptor.h"
class UBDocumentProxy; class UBDocumentProxy;
class UBImportPDF : public UBImportAdaptor class UBImportPDF : public UBImportAdaptor

@ -17,6 +17,7 @@
#include <windows.h> #include <windows.h>
#include "core/memcheck.h"
QString UBImportVirtualPrinter::sOriginalDefaultPrintername = ""; QString UBImportVirtualPrinter::sOriginalDefaultPrintername = "";

@ -7,6 +7,8 @@
#include "UBIniFileParser.h" #include "UBIniFileParser.h"
#include "core/memcheck.h"
UBIniFileParser::UBIniFileParser(const QString& pFileName) UBIniFileParser::UBIniFileParser(const QString& pFileName)
{ {
QFile file(pFileName); QFile file(pFileName);

@ -16,6 +16,8 @@
#include "document/UBDocumentProxy.h" #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::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::nsDc = "http://purl.org/dc/elements/1.1/";
const QString UBMetadataDcSubsetAdaptor::metadataFilename = "metadata.rdf"; const QString UBMetadataDcSubsetAdaptor::metadataFilename = "metadata.rdf";

@ -41,6 +41,8 @@
#include "pdf/PDFRenderer.h" #include "pdf/PDFRenderer.h"
#include "core/memcheck.h"
const QString UBSvgSubsetAdaptor::nsSvg = "http://www.w3.org/2000/svg"; const QString UBSvgSubsetAdaptor::nsSvg = "http://www.w3.org/2000/svg";
const QString UBSvgSubsetAdaptor::nsXHtml = "http://www.w3.org/1999/xhtml"; const QString UBSvgSubsetAdaptor::nsXHtml = "http://www.w3.org/1999/xhtml";
const QString UBSvgSubsetAdaptor::nsXLink = "http://www.w3.org/1999/xlink"; const QString UBSvgSubsetAdaptor::nsXLink = "http://www.w3.org/1999/xlink";
@ -410,7 +412,14 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
} }
else if (mXmlReader.name() == "g") 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"); QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value");
@ -747,7 +756,11 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
{ {
if (mXmlReader.name() == "g") if (mXmlReader.name() == "g")
{ {
annotationGroup = 0; if (annotationGroup)
{
if (!annotationGroup->polygons().empty())
annotationGroup = 0;
}
mGroupHasInfo = false; mGroupHasInfo = false;
mGroupDarkBackgroundColor = QColor(); mGroupDarkBackgroundColor = QColor();
mGroupLightBackgroundColor = QColor(); mGroupLightBackgroundColor = QColor();
@ -767,6 +780,12 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
scene->setModified(false); scene->setModified(false);
} }
if (annotationGroup)
{
if (annotationGroup->polygons().empty())
delete annotationGroup;
}
return scene; return scene;
} }

@ -15,6 +15,8 @@
#include "UBSvgSubsetAdaptor.h" #include "UBSvgSubsetAdaptor.h"
#include "core/memcheck.h"
UBThumbnailAdaptor::UBThumbnailAdaptor(QObject *parent) UBThumbnailAdaptor::UBThumbnailAdaptor(QObject *parent)
: QObject(parent) : QObject(parent)
{ {

@ -11,7 +11,7 @@
#include "adaptors/publishing/UBDocumentPublisher.h" #include "adaptors/publishing/UBDocumentPublisher.h"
#include "core/memcheck.h"
UBWebPublisher::UBWebPublisher(QObject *parent) UBWebPublisher::UBWebPublisher(QObject *parent)
: UBExportAdaptor(parent) : UBExportAdaptor(parent)

@ -11,6 +11,8 @@
#include "network/UBNetworkAccessManager.h" #include "network/UBNetworkAccessManager.h"
#include "network/UBServerXMLHttpRequest.h" #include "network/UBServerXMLHttpRequest.h"
#include "core/memcheck.h"
UBAbstractPublisher::UBAbstractPublisher(QObject *parent) UBAbstractPublisher::UBAbstractPublisher(QObject *parent)
: QObject(parent) : QObject(parent)
, mTokenRequest(0) , mTokenRequest(0)

@ -14,6 +14,7 @@
#include "domain/UBGraphicsScene.h" #include "domain/UBGraphicsScene.h"
#include "core/memcheck.h"
UBCapturePublisher::UBCapturePublisher(const QPixmap& pixmap, QObject *parent) UBCapturePublisher::UBCapturePublisher(const QPixmap& pixmap, QObject *parent)
: UBAbstractPublisher(parent) : UBAbstractPublisher(parent)

@ -7,7 +7,6 @@
#include "UBAbstractPublisher.h" #include "UBAbstractPublisher.h"
class UBServerXMLHttpRequest; class UBServerXMLHttpRequest;
class UBCapturePublisher : public UBAbstractPublisher class UBCapturePublisher : public UBAbstractPublisher

@ -26,6 +26,7 @@
#include "UBSvgSubsetRasterizer.h" #include "UBSvgSubsetRasterizer.h"
#include "core/memcheck.h"
UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *parent) UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *parent)
: UBAbstractPublisher(parent) : UBAbstractPublisher(parent)

@ -10,6 +10,8 @@
#include "domain/UBGraphicsScene.h" #include "domain/UBGraphicsScene.h"
#include "adaptors/UBSvgSubsetAdaptor.h" #include "adaptors/UBSvgSubsetAdaptor.h"
#include "core/memcheck.h"
UBSvgSubsetRasterizer::UBSvgSubsetRasterizer(UBDocumentProxy* document, int pageIndex, QObject* parent) UBSvgSubsetRasterizer::UBSvgSubsetRasterizer(UBDocumentProxy* document, int pageIndex, QObject* parent)
: QObject(parent) : QObject(parent)
, mDocument(document) , mDocument(document)

@ -16,6 +16,8 @@
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "core/memcheck.h"
UBAbstractVotingSystem::UBAbstractVotingSystem(QObject *parent) UBAbstractVotingSystem::UBAbstractVotingSystem(QObject *parent)
: QObject(parent) : QObject(parent)
{ {

@ -9,6 +9,8 @@
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "core/memcheck.h"
UBReply2005VotingSystem::UBReply2005VotingSystem(QWidget *parent) UBReply2005VotingSystem::UBReply2005VotingSystem(QWidget *parent)
: UBAbstractVotingSystem(parent) : UBAbstractVotingSystem(parent)
, mParent(parent) , mParent(parent)

@ -10,6 +10,8 @@
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/memcheck.h"
UBReplyWRS970VotingSystem::UBReplyWRS970VotingSystem(QWidget *parent) UBReplyWRS970VotingSystem::UBReplyWRS970VotingSystem(QWidget *parent)
: UBAbstractVotingSystem(parent) : UBAbstractVotingSystem(parent)
, mParent(parent) , mParent(parent)

@ -10,6 +10,8 @@
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "core/memcheck.h"
UBLibraryAPI::UBLibraryAPI(QWebView *pWebView) UBLibraryAPI::UBLibraryAPI(QWebView *pWebView)
: QObject(pWebView) : QObject(pWebView)
, mWebView(pWebView) , mWebView(pWebView)

@ -20,6 +20,7 @@
#include "UBWidgetMessageAPI.h" #include "UBWidgetMessageAPI.h"
#include "core/memcheck.h"
UBW3CWidgetAPI::UBW3CWidgetAPI(UBGraphicsW3CWidgetItem *graphicsWidget) UBW3CWidgetAPI::UBW3CWidgetAPI(UBGraphicsW3CWidgetItem *graphicsWidget)
: QObject(graphicsWidget) : QObject(graphicsWidget)

@ -11,6 +11,8 @@
#include "domain/UBAbstractWidget.h" #include "domain/UBAbstractWidget.h"
#include "core/memcheck.h"
UBWidgetMessageAPI::UBWidgetMessageAPI(UBW3CWidget *widget) UBWidgetMessageAPI::UBWidgetMessageAPI(UBW3CWidget *widget)
: QObject(widget) : QObject(widget)
, mWebWidget(widget) , mWebWidget(widget)

@ -12,7 +12,6 @@
#include "domain/UBGraphicsWidgetItem.h" #include "domain/UBGraphicsWidgetItem.h"
class UBWidgetMessageAPI : public QObject class UBWidgetMessageAPI : public QObject
{ {
Q_OBJECT; Q_OBJECT;

@ -19,6 +19,7 @@
#include "UBWidgetMessageAPI.h" #include "UBWidgetMessageAPI.h"
#include "core/memcheck.h"
UBWidgetUniboardAPI::UBWidgetUniboardAPI(UBGraphicsScene *pScene, UBGraphicsWidgetItem *widget) UBWidgetUniboardAPI::UBWidgetUniboardAPI(UBGraphicsScene *pScene, UBGraphicsWidgetItem *widget)
: QObject(pScene) : QObject(pScene)

@ -9,6 +9,7 @@
#include "adaptors/voting/UBAbstractVotingSystem.h" #include "adaptors/voting/UBAbstractVotingSystem.h"
#include "core/memcheck.h"
UBWidgetVotingSystemAPI::UBWidgetVotingSystemAPI(QObject* parent) UBWidgetVotingSystemAPI::UBWidgetVotingSystemAPI(QObject* parent)
: QObject(parent) : QObject(parent)

@ -49,6 +49,8 @@
#include "UBBoardPaletteManager.h" #include "UBBoardPaletteManager.h"
#include "core/memcheck.h"
UBBoardController::UBBoardController(UBMainWindow* mainWindow) UBBoardController::UBBoardController(UBMainWindow* mainWindow)
: QObject(mainWindow->centralWidget()) : QObject(mainWindow->centralWidget())
, mMainWindow(mainWindow) , mMainWindow(mainWindow)
@ -999,6 +1001,11 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
{ {
mActiveScene->addProtractor(pPos); mActiveScene->addProtractor(pPos);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); 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) else if (sourceUrl.toString() == UBToolsManager::manager()->mask.id)
{ {

@ -50,6 +50,7 @@
#include "UBBoardController.h" #include "UBBoardController.h"
#include "core/memcheck.h"
UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardController* pBoardController) UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardController* pBoardController)
: QObject(container) : QObject(container)

@ -39,6 +39,8 @@
#include "frameworks/UBPlatformUtils.h" #include "frameworks/UBPlatformUtils.h"
#include "core/memcheck.h"
UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent) UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent)
: QGraphicsView (pParent) : QGraphicsView (pParent)
, mController (pController) , mController (pController)

@ -12,6 +12,8 @@
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "core/memcheck.h"
UBDrawingController* UBDrawingController::sDrawingController = 0; UBDrawingController* UBDrawingController::sDrawingController = 0;

@ -26,6 +26,8 @@
#include "gui/UBThumbnailWidget.h" #include "gui/UBThumbnailWidget.h"
#include "../core/UBSettings.h" #include "../core/UBSettings.h"
#include "core/memcheck.h"
static quint32 magicNumber = 0xACDCAFE0; static quint32 magicNumber = 0xACDCAFE0;
static QString favoriteVirtualPath = "$favorite$"; static QString favoriteVirtualPath = "$favorite$";

@ -58,9 +58,21 @@ struct UBGraphicsItemType
{ {
enum Enum enum Enum
{ {
PolygonItemType = QGraphicsItem::UserType + 1, PixmapItemType, PolygonItemType = QGraphicsItem::UserType + 1,
SvgItemType, VideoItemType, AudioItemType, AppleWidgetItemType, PDFItemType, TextItemType, W3CWidgetItemType, CurtainItemType, PixmapItemType,
RulerItemType, CompassItemType, ProtractorItemType, StrokeItemType SvgItemType,
VideoItemType,
AudioItemType,
AppleWidgetItemType,
PDFItemType,
TextItemType,
W3CWidgetItemType,
CurtainItemType,
RulerItemType,
CompassItemType,
ProtractorItemType,
StrokeItemType,
TriangleItemType
}; };
}; };

@ -45,6 +45,7 @@
#include "ui_mainWindow.h" #include "ui_mainWindow.h"
#include "core/memcheck.h"
QPointer<QUndoStack> UBApplication::undoStack; QPointer<QUndoStack> UBApplication::undoStack;
@ -91,7 +92,8 @@ static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event,
UBApplication::UBApplication(const QString &id, int &argc, char **argv) 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 staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor
@ -183,6 +185,12 @@ UBApplication::~UBApplication()
delete mUniboardSankoreTransition; delete mUniboardSankoreTransition;
mUniboardSankoreTransition = 0; mUniboardSankoreTransition = 0;
if (mPreferencesController)
{
delete mPreferencesController;
mPreferencesController = 0;
}
} }
int UBApplication::exec(const QString& pFileToImport) int UBApplication::exec(const QString& pFileToImport)
@ -537,6 +545,22 @@ bool UBApplication::handleOpenMessage(const QString& pMessage)
return true; 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, void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole) const bool enabled, const QString& text, QPalette::ColorRole textRole) const
{ {

@ -44,6 +44,8 @@ class UBApplication : public QtSingleApplication
int exec(const QString& pFileToImport); int exec(const QString& pFileToImport);
void cleanup();
static QPointer<QUndoStack> undoStack; static QPointer<QUndoStack> undoStack;
static UBApplicationController *applicationController; static UBApplicationController *applicationController;

@ -41,6 +41,8 @@
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#endif #endif
#include "core/memcheck.h"
UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBoardView *pDisplayView, UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBoardView *pDisplayView,
UBMainWindow* pMainWindow, QObject* parent) UBMainWindow* pMainWindow, QObject* parent)
: QObject(parent) : QObject(parent)
@ -53,6 +55,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo
, mAutomaticCheckForUpdates(false) , mAutomaticCheckForUpdates(false)
, mCheckingForUpdates(false) , mCheckingForUpdates(false)
, mIsShowingDesktop(false) , mIsShowingDesktop(false)
, mFtp(0)
{ {
mDisplayManager = new UBDisplayManager(this); mDisplayManager = new UBDisplayManager(this);
@ -103,6 +106,7 @@ UBApplicationController::~UBApplicationController()
delete mBlackScene; delete mBlackScene;
delete mMirror; delete mMirror;
if (mFtp) delete mFtp;
} }
@ -479,6 +483,8 @@ void UBApplicationController::showSankoreEditor()
void UBApplicationController::checkUpdate() void UBApplicationController::checkUpdate()
{ {
if (mFtp!=NULL)
delete mFtp;
mFtp = new QFtp(this); mFtp = new QFtp(this);
connect(mFtp, SIGNAL(commandFinished(int,bool)), this, SLOT(ftpCommandFinished(int,bool))); connect(mFtp, SIGNAL(commandFinished(int,bool)), this, SLOT(ftpCommandFinished(int,bool)));

@ -18,6 +18,7 @@
#include "ui_blackoutWidget.h" #include "ui_blackoutWidget.h"
#include "core/memcheck.h"
UBDisplayManager::UBDisplayManager(QObject *parent) UBDisplayManager::UBDisplayManager(QObject *parent)
: QObject(parent) : QObject(parent)

@ -28,6 +28,8 @@
#include "UBSettings.h" #include "UBSettings.h"
#include "UBPersistenceManager.h" #include "UBPersistenceManager.h"
#include "core/memcheck.h"
UBDocumentManager* UBDocumentManager::sDocumentManager = 0; UBDocumentManager* UBDocumentManager::sDocumentManager = 0;
UBDocumentManager* UBDocumentManager::documentManager() UBDocumentManager* UBDocumentManager::documentManager()

@ -11,6 +11,8 @@
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "board/UBBoardView.h" #include "board/UBBoardView.h"
#include "core/memcheck.h"
UBIdleTimer::UBIdleTimer(QObject *parent) UBIdleTimer::UBIdleTimer(QObject *parent)
: QObject(parent) : QObject(parent)
, mCursorIsHidden(false) , mCursorIsHidden(false)

@ -12,6 +12,8 @@
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "domain/UBItem.h" #include "domain/UBItem.h"
#include "core/memcheck.h"
UBMimeDataItem::UBMimeDataItem(UBDocumentProxy* proxy, int sceneIndex) UBMimeDataItem::UBMimeDataItem(UBDocumentProxy* proxy, int sceneIndex)
: mProxy(proxy) : mProxy(proxy)
, mSceneIndex(sceneIndex) , mSceneIndex(sceneIndex)

@ -24,6 +24,7 @@
#include "adaptors/UBThumbnailAdaptor.h" #include "adaptors/UBThumbnailAdaptor.h"
#include "adaptors/UBMetadataDcSubsetAdaptor.h" #include "adaptors/UBMetadataDcSubsetAdaptor.h"
#include "core/memcheck.h"
const QString UBPersistenceManager::imageDirectory = "images"; // added to UBPersistenceManager::mAllDirectories const QString UBPersistenceManager::imageDirectory = "images"; // added to UBPersistenceManager::mAllDirectories
const QString UBPersistenceManager::objectDirectory = "objects"; // added to UBPersistenceManager::mAllDirectories const QString UBPersistenceManager::objectDirectory = "objects"; // added to UBPersistenceManager::mAllDirectories

@ -22,6 +22,8 @@
#include "ui_preferences.h" #include "ui_preferences.h"
#include "core/memcheck.h"
qreal UBPreferencesController::sSliderRatio = 10.0; qreal UBPreferencesController::sSliderRatio = 10.0;
qreal UBPreferencesController::sMinPenWidth = 0.5; qreal UBPreferencesController::sMinPenWidth = 0.5;
qreal UBPreferencesController::sMaxPenWidth = 50.0; qreal UBPreferencesController::sMaxPenWidth = 50.0;
@ -43,6 +45,8 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
UBPreferencesController::~UBPreferencesController() UBPreferencesController::~UBPreferencesController()
{ {
delete mPreferencesWindow;
delete mPreferencesUI; delete mPreferencesUI;
delete mPenProperties; delete mPenProperties;

@ -9,6 +9,7 @@
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "core/memcheck.h"
UBSceneCache::UBSceneCache() UBSceneCache::UBSceneCache()
: mCachedSceneCount(0) : mCachedSceneCount(0)

@ -11,6 +11,7 @@
#include "UBSettings.h" #include "UBSettings.h"
#include "core/memcheck.h"
UBSetting::UBSetting(UBSettings* parent) : UBSetting::UBSetting(UBSettings* parent) :
QObject(parent) QObject(parent)

@ -21,6 +21,8 @@
#include "tools/UBToolsManager.h" #include "tools/UBToolsManager.h"
#include "core/memcheck.h"
QPointer<UBSettings> UBSettings::sSingleton = 0; QPointer<UBSettings> UBSettings::sSingleton = 0;
int UBSettings::pointerDiameter = 40; int UBSettings::pointerDiameter = 40;

@ -1,16 +1,21 @@
#include <QtGui> #include <QtGui>
#include <QTextCodec> #include <QTextCodec>
#if (defined(Q_WS_WIN) && defined(_DEBUG))
//#include <vld.h>
#endif
#include "frameworks/UBPlatformUtils.h" #include "frameworks/UBPlatformUtils.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "UBApplication.h" #include "UBApplication.h"
#include "UBSettings.h" #include "UBSettings.h"
#if defined(WIN32) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new( _NORMAL_BLOCK, __FILE__, __LINE__ )
#define new DEBUG_NEW
#endif
void ub_message_output(QtMsgType type, const char *msg) { void ub_message_output(QtMsgType type, const char *msg) {
// We must temporarily remove the handler to avoid the infinite recursion of // We must temporarily remove the handler to avoid the infinite recursion of
// ub_message_output -> qt_message_output -> ub_message_output -> qt_message_output ... // 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); 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); Q_INIT_RESOURCE(sankore);
qInstallMsgHandler(ub_message_output); qInstallMsgHandler(ub_message_output);
@ -96,8 +106,12 @@ int main(int argc, char *argv[]) {
int result = app.exec(fileToOpen); int result = app.exec(fileToOpen);
app.cleanup();
qDebug() << "application is quitting"; qDebug() << "application is quitting";
return result; return result;
} }

@ -9,6 +9,8 @@
#include "gui/UBRubberBand.h" #include "gui/UBRubberBand.h"
#include "core/memcheck.h"
UBCustomCaptureWindow::UBCustomCaptureWindow(QWidget *parent) UBCustomCaptureWindow::UBCustomCaptureWindow(QWidget *parent)
: QDialog(parent, Qt::FramelessWindowHint | Qt::Window) : QDialog(parent, Qt::FramelessWindowHint | Qt::Window)
, mSelectionBand(0) , mSelectionBand(0)

@ -36,6 +36,8 @@
#include "gui/UBKeyboardPalette.h" #include "gui/UBKeyboardPalette.h"
#include "core/memcheck.h"
UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
: QObject(parent) : QObject(parent)
, mTransparentDrawingView(0) , mTransparentDrawingView(0)
@ -138,6 +140,7 @@ UBDesktopAnnotationController::~UBDesktopAnnotationController()
delete mTransparentDrawingScene; delete mTransparentDrawingScene;
delete mTransparentDrawingView; delete mTransparentDrawingView;
/*
if(NULL != mDesktopPenPalette) if(NULL != mDesktopPenPalette)
{ {
delete mDesktopPalette; delete mDesktopPalette;
@ -158,6 +161,7 @@ UBDesktopAnnotationController::~UBDesktopAnnotationController()
delete mLibPalette; delete mLibPalette;
mLibPalette = NULL; mLibPalette = NULL;
} }
*/
} }

@ -7,6 +7,9 @@
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h" #include "gui/UBToolbarButtonGroup.h"
#include "core/memcheck.h"
UBDesktopEraserPalette::UBDesktopEraserPalette(QWidget *parent) UBDesktopEraserPalette::UBDesktopEraserPalette(QWidget *parent)
: UBPropertyPalette(Qt::Horizontal, parent) : UBPropertyPalette(Qt::Horizontal, parent)
{ {

@ -6,6 +6,8 @@
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h" #include "gui/UBToolbarButtonGroup.h"
#include "core/memcheck.h"
UBDesktopMarkerPalette::UBDesktopMarkerPalette(QWidget *parent) UBDesktopMarkerPalette::UBDesktopMarkerPalette(QWidget *parent)
: UBPropertyPalette(Qt::Horizontal, parent) : UBPropertyPalette(Qt::Horizontal, parent)
{ {

@ -19,6 +19,7 @@
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "core/memcheck.h"
UBDesktopPalette::UBDesktopPalette(QWidget *parent) UBDesktopPalette::UBDesktopPalette(QWidget *parent)
: UBActionPalette(Qt::TopLeftCorner, parent) : UBActionPalette(Qt::TopLeftCorner, parent)

@ -6,6 +6,8 @@
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h" #include "gui/UBToolbarButtonGroup.h"
#include "core/memcheck.h"
UBDesktopPenPalette::UBDesktopPenPalette(QWidget *parent) UBDesktopPenPalette::UBDesktopPenPalette(QWidget *parent)
: UBPropertyPalette(Qt::Horizontal, parent) : UBPropertyPalette(Qt::Horizontal, parent)
{ {

@ -9,6 +9,7 @@
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h" #include "gui/UBToolbarButtonGroup.h"
#include "core/memcheck.h"
UBDesktopToolsPalette::UBDesktopToolsPalette(QWidget *parent) UBDesktopToolsPalette::UBDesktopToolsPalette(QWidget *parent)
: UBActionPalette(Qt::Horizontal, parent) : UBActionPalette(Qt::Horizontal, parent)

@ -1,6 +1,7 @@
#include "UBWindowCaptureDelegate_win.h" #include "UBWindowCaptureDelegate_win.h"
#include <windows.h> #include <windows.h>
#include "core/memcheck.h"
UBWindowCaptureDelegate::UBWindowCaptureDelegate(QObject *parent) UBWindowCaptureDelegate::UBWindowCaptureDelegate(QObject *parent)
:QObject(parent) :QObject(parent)

@ -13,6 +13,8 @@
#include "board/UBBoardView.h" #include "board/UBBoardView.h"
#include "core/memcheck.h"
UBWindowCapture::UBWindowCapture(UBDesktopAnnotationController *parent) UBWindowCapture::UBWindowCapture(UBDesktopAnnotationController *parent)
: QObject(parent) : QObject(parent)
, mParent(parent) , mParent(parent)

@ -39,6 +39,7 @@
#include "ui_documents.h" #include "ui_documents.h"
#include "ui_mainWindow.h" #include "ui_mainWindow.h"
#include "core/memcheck.h"
UBDocumentController::UBDocumentController(UBMainWindow* mainWindow) UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
: QObject(mainWindow->centralWidget()) : QObject(mainWindow->centralWidget())

@ -14,6 +14,7 @@
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "core/UBDocumentManager.h" #include "core/UBDocumentManager.h"
#include "core/memcheck.h"
UBDocumentProxy::UBDocumentProxy() UBDocumentProxy::UBDocumentProxy()
: mPageCount(0) : mPageCount(0)

@ -24,6 +24,7 @@
#include "web/UBWebKitUtils.h" #include "web/UBWebKitUtils.h"
#include "web/UBWebController.h" #include "web/UBWebController.h"
#include "core/memcheck.h"
QStringList UBAbstractWidget::sInlineJavaScripts; QStringList UBAbstractWidget::sInlineJavaScripts;
bool UBAbstractWidget::sInlineJavaScriptLoaded = false; bool UBAbstractWidget::sInlineJavaScriptLoaded = false;

@ -16,6 +16,7 @@
#include "network/UBNetworkAccessManager.h" #include "network/UBNetworkAccessManager.h"
#include "core/memcheck.h"
UBAppleWidget::UBAppleWidget(const QUrl& pWidgetUrl, QWidget *parent) UBAppleWidget::UBAppleWidget(const QUrl& pWidgetUrl, QWidget *parent)
: UBAbstractWidget(pWidgetUrl, parent) : UBAbstractWidget(pWidgetUrl, parent)

@ -10,6 +10,7 @@
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "UBGraphicsScene.h" #include "UBGraphicsScene.h"
#include "core/memcheck.h"
UBDocumentUndoCommand::UBDocumentUndoCommand(UBDocumentProxy* pDocument, const QList<UBGraphicsScene*>& pOldScenes, UBDocumentUndoCommand::UBDocumentUndoCommand(UBDocumentProxy* pDocument, const QList<UBGraphicsScene*>& pOldScenes,
const QList<UBGraphicsScene*>& pNewScenes, const int& pActiveSceneIndex) const QList<UBGraphicsScene*>& pNewScenes, const int& pActiveSceneIndex)

@ -2,6 +2,7 @@
#include "UBGraphicsAudioItemDelegate.h" #include "UBGraphicsAudioItemDelegate.h"
#include "UBGraphicsDelegateFrame.h" #include "UBGraphicsDelegateFrame.h"
#include "core/memcheck.h"
UBGraphicsAudioItem::UBGraphicsAudioItem(const QUrl& pAudioFileUrl, QGraphicsItem *parent): UBGraphicsAudioItem::UBGraphicsAudioItem(const QUrl& pAudioFileUrl, QGraphicsItem *parent):
UBGraphicsMediaItem(pAudioFileUrl,parent) UBGraphicsMediaItem(pAudioFileUrl,parent)

@ -3,6 +3,8 @@
#include "domain/UBGraphicsDelegateFrame.h" #include "domain/UBGraphicsDelegateFrame.h"
#include "UBGraphicsScene.h" #include "UBGraphicsScene.h"
#include "core/memcheck.h"
UBGraphicsAudioItemDelegate::UBGraphicsAudioItemDelegate ( UBGraphicsAudioItem* pDelegated, QObject *parent ) UBGraphicsAudioItemDelegate::UBGraphicsAudioItemDelegate ( UBGraphicsAudioItem* pDelegated, QObject *parent )
: UBGraphicsItemDelegate ( pDelegated, parent ) : UBGraphicsItemDelegate ( pDelegated, parent )
, mDelegated ( pDelegated ) , mDelegated ( pDelegated )

@ -19,6 +19,8 @@
#include "gui/UBResources.h" #include "gui/UBResources.h"
#include "core/memcheck.h"
qreal const UBGraphicsDelegateFrame::mAngleTolerance = 6; qreal const UBGraphicsDelegateFrame::mAngleTolerance = 6;
UBGraphicsDelegateFrame::UBGraphicsDelegateFrame(UBGraphicsItemDelegate* pDelegate, QRectF pRect, qreal pFrameWidth, bool respectRatio) UBGraphicsDelegateFrame::UBGraphicsDelegateFrame(UBGraphicsItemDelegate* pDelegate, QRectF pRect, qreal pFrameWidth, bool respectRatio)

@ -35,6 +35,8 @@
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "board/UBDrawingController.h" #include "board/UBDrawingController.h"
#include "core/memcheck.h"
class UBGraphicsParaschoolEditorWidgetItem; class UBGraphicsParaschoolEditorWidgetItem;
UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent, bool respectRatio, bool canRotate) UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent, bool respectRatio, bool canRotate)

@ -8,6 +8,7 @@
#include "UBGraphicsItemTransformUndoCommand.h" #include "UBGraphicsItemTransformUndoCommand.h"
#include "UBResizableGraphicsItem.h" #include "UBResizableGraphicsItem.h"
#include "core/memcheck.h"
UBGraphicsItemTransformUndoCommand::UBGraphicsItemTransformUndoCommand(QGraphicsItem* pItem, UBGraphicsItemTransformUndoCommand::UBGraphicsItemTransformUndoCommand(QGraphicsItem* pItem,
const QPointF& prevPos, const QTransform& prevTransform, const qreal& prevZValue, const QPointF& prevPos, const QTransform& prevTransform, const qreal& prevZValue,

@ -11,6 +11,8 @@
#include "UBGraphicsScene.h" #include "UBGraphicsScene.h"
#include "core/memcheck.h"
UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, const QSet<QGraphicsItem*>& pRemovedItems, UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, const QSet<QGraphicsItem*>& pRemovedItems,
const QSet<QGraphicsItem*>& pAddedItems) const QSet<QGraphicsItem*>& pAddedItems)

@ -8,6 +8,8 @@
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "core/memcheck.h"
bool UBGraphicsMediaItem::sIsMutedByDefault = false; bool UBGraphicsMediaItem::sIsMutedByDefault = false;
UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent) UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent)

@ -7,6 +7,7 @@
#include "UBGraphicsPixmapItem.h" #include "UBGraphicsPixmapItem.h"
#include "UBGraphicsItemDelegate.h" #include "UBGraphicsItemDelegate.h"
#include "core/memcheck.h"
UBGraphicsPDFItem::UBGraphicsPDFItem(PDFRenderer *renderer, int pageNumber, QGraphicsItem* parent) UBGraphicsPDFItem::UBGraphicsPDFItem(PDFRenderer *renderer, int pageNumber, QGraphicsItem* parent)
: GraphicsPDFItem(renderer, pageNumber, parent) : GraphicsPDFItem(renderer, pageNumber, parent)

@ -15,6 +15,8 @@
#include "UBGraphicsItemDelegate.h" #include "UBGraphicsItemDelegate.h"
#include "core/memcheck.h"
UBGraphicsPixmapItem::UBGraphicsPixmapItem(QGraphicsItem* parent/*, QString pSource*/) UBGraphicsPixmapItem::UBGraphicsPixmapItem(QGraphicsItem* parent/*, QString pSource*/)
: QGraphicsPixmapItem(parent) : QGraphicsPixmapItem(parent)
{ {

@ -3,7 +3,10 @@
#include "frameworks/UBGeometryUtils.h" #include "frameworks/UBGeometryUtils.h"
#include "UBGraphicsScene.h" #include "UBGraphicsScene.h"
#include "domain/UBGraphicsPolygonItem.h"
#include "domain/UBGraphicsStroke.h"
#include "core/memcheck.h"
UBGraphicsPolygonItem::UBGraphicsPolygonItem (QGraphicsItem * parent) UBGraphicsPolygonItem::UBGraphicsPolygonItem (QGraphicsItem * parent)
: QGraphicsPolygonItem(parent) : QGraphicsPolygonItem(parent)
@ -39,7 +42,15 @@ UBGraphicsPolygonItem::UBGraphicsPolygonItem (const QLineF& pLine, qreal pWidth)
UBGraphicsPolygonItem::~UBGraphicsPolygonItem() UBGraphicsPolygonItem::~UBGraphicsPolygonItem()
{ {
// NOOP if (mStroke!=NULL)
{
QList<UBGraphicsPolygonItem*> pp = mStroke->polygons();
int n = pp.indexOf(this);
if (n>=0)
pp.removeAt(n);
if (pp.empty())
delete mStroke;
}
} }

@ -14,6 +14,7 @@
#include "UBGraphicsDelegateFrame.h" #include "UBGraphicsDelegateFrame.h"
#include "core/memcheck.h"
UBGraphicsProxyWidget::UBGraphicsProxyWidget(QGraphicsItem* parent) UBGraphicsProxyWidget::UBGraphicsProxyWidget(QGraphicsItem* parent)
: QGraphicsProxyWidget(parent, Qt::FramelessWindowHint) : QGraphicsProxyWidget(parent, Qt::FramelessWindowHint)

@ -23,6 +23,7 @@
#include "tools/UBGraphicsRuler.h" #include "tools/UBGraphicsRuler.h"
#include "tools/UBGraphicsProtractor.h" #include "tools/UBGraphicsProtractor.h"
#include "tools/UBGraphicsCompass.h" #include "tools/UBGraphicsCompass.h"
#include "tools/UBGraphicsTriangle.h"
#include "tools/UBGraphicsCurtainItem.h" #include "tools/UBGraphicsCurtainItem.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
@ -46,6 +47,8 @@
#include "UBW3CWidget.h" #include "UBW3CWidget.h"
#include "UBGraphicsStroke.h" #include "UBGraphicsStroke.h"
#include "core/memcheck.h"
qreal UBGraphicsScene::backgroundLayerStart = -20000000.0; qreal UBGraphicsScene::backgroundLayerStart = -20000000.0;
qreal UBGraphicsScene::objectLayerStart = -10000000.0; qreal UBGraphicsScene::objectLayerStart = -10000000.0;
qreal UBGraphicsScene::drawingLayerStart = 0.0; qreal UBGraphicsScene::drawingLayerStart = 0.0;
@ -122,6 +125,7 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
UBGraphicsScene::~UBGraphicsScene() UBGraphicsScene::~UBGraphicsScene()
{ {
int a = 13;
// NOOP // NOOP
} }
@ -1405,6 +1409,25 @@ void UBGraphicsScene::addProtractor(QPointF center)
setModified(true); 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) void UBGraphicsScene::addCompass(QPointF center)
{ {

@ -156,8 +156,10 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
qreal getNextObjectZIndex(); qreal getNextObjectZIndex();
void addRuler(QPointF center); void addRuler(QPointF center);
void addTriangle(QPointF center);
void addProtractor(QPointF center); void addProtractor(QPointF center);
void addCompass(QPointF center); void addCompass(QPointF center);
void addMask(); void addMask();
class SceneViewState class SceneViewState

@ -9,6 +9,7 @@
#include "UBGraphicsPolygonItem.h" #include "UBGraphicsPolygonItem.h"
#include "core/memcheck.h"
UBGraphicsStroke::UBGraphicsStroke() UBGraphicsStroke::UBGraphicsStroke()
{ {

@ -13,6 +13,7 @@
#include "UBGraphicsItemDelegate.h" #include "UBGraphicsItemDelegate.h"
#include "UBGraphicsPixmapItem.h" #include "UBGraphicsPixmapItem.h"
#include "core/memcheck.h"
UBGraphicsSvgItem::UBGraphicsSvgItem(const QString& pFilePath, QGraphicsItem* parent) UBGraphicsSvgItem::UBGraphicsSvgItem(const QString& pFilePath, QGraphicsItem* parent)
: QGraphicsSvgItem(pFilePath, parent) : QGraphicsSvgItem(pFilePath, parent)

@ -16,6 +16,7 @@
#include "board/UBBoardView.h" #include "board/UBBoardView.h"
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "core/memcheck.h"
QColor UBGraphicsTextItem::lastUsedTextColor; QColor UBGraphicsTextItem::lastUsedTextColor;

@ -18,6 +18,7 @@
#include "core/UBApplicationController.h" // TODO UB 4.x clean that dependency #include "core/UBApplicationController.h" // TODO UB 4.x clean that dependency
#include "core/UBDisplayManager.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; const int UBGraphicsTextItemDelegate::sMinPixelSize = 8;

@ -8,6 +8,7 @@
#include "UBGraphicsTextItemUndoCommand.h" #include "UBGraphicsTextItemUndoCommand.h"
#include "UBGraphicsTextItem.h" #include "UBGraphicsTextItem.h"
#include "core/memcheck.h"
UBGraphicsTextItemUndoCommand::UBGraphicsTextItemUndoCommand(UBGraphicsTextItem *textItem) UBGraphicsTextItemUndoCommand::UBGraphicsTextItemUndoCommand(UBGraphicsTextItem *textItem)
: mTextItem(textItem) : mTextItem(textItem)

@ -2,6 +2,7 @@
#include "UBGraphicsVideoItemDelegate.h" #include "UBGraphicsVideoItemDelegate.h"
#include "UBGraphicsDelegateFrame.h" #include "UBGraphicsDelegateFrame.h"
#include "core/memcheck.h"
UBGraphicsVideoItem::UBGraphicsVideoItem(const QUrl& pVideoFileUrl, QGraphicsItem *parent): UBGraphicsVideoItem::UBGraphicsVideoItem(const QUrl& pVideoFileUrl, QGraphicsItem *parent):
UBGraphicsMediaItem(pVideoFileUrl,parent) UBGraphicsMediaItem(pVideoFileUrl,parent)

@ -21,7 +21,7 @@
#include "domain/UBGraphicsVideoItem.h" #include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsDelegateFrame.h" #include "domain/UBGraphicsDelegateFrame.h"
#include "core/memcheck.h"
UBGraphicsVideoItemDelegate::UBGraphicsVideoItemDelegate(UBGraphicsVideoItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent) UBGraphicsVideoItemDelegate::UBGraphicsVideoItemDelegate(UBGraphicsVideoItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent)
: UBGraphicsItemDelegate(pDelegated, parent, true, false) : UBGraphicsItemDelegate(pDelegated, parent, true, false)

@ -11,6 +11,8 @@
#include "UBGraphicsScene.h" #include "UBGraphicsScene.h"
#include "UBAppleWidget.h" #include "UBAppleWidget.h"
#include "core/memcheck.h"
UBGraphicsWidgetItem::UBGraphicsWidgetItem(QGraphicsItem *parent, int widgetType) UBGraphicsWidgetItem::UBGraphicsWidgetItem(QGraphicsItem *parent, int widgetType)
: UBGraphicsProxyWidget(parent) : UBGraphicsProxyWidget(parent)
, mWebKitWidget(0) , mWebKitWidget(0)

@ -22,6 +22,7 @@
#include "domain/UBGraphicsWidgetItem.h" #include "domain/UBGraphicsWidgetItem.h"
#include "domain/UBGraphicsDelegateFrame.h" #include "domain/UBGraphicsDelegateFrame.h"
#include "core/memcheck.h"
UBGraphicsWidgetItemDelegate::UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType) UBGraphicsWidgetItemDelegate::UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType)
: UBGraphicsItemDelegate(pDelegated, 0, true, false) : UBGraphicsItemDelegate(pDelegated, 0, true, false)

@ -1,5 +1,7 @@
#include "UBItem.h" #include "UBItem.h"
#include "core/memcheck.h"
UBItem::UBItem() UBItem::UBItem()
: mUuid(QUuid::createUuid()) : mUuid(QUuid::createUuid())
, mRenderingQuality(UBItem::RenderingQualityNormal) , mRenderingQuality(UBItem::RenderingQualityNormal)

@ -13,6 +13,7 @@
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "UBGraphicsScene.h" #include "UBGraphicsScene.h"
#include "core/memcheck.h"
UBPageSizeUndoCommand::UBPageSizeUndoCommand(UBGraphicsScene* pScene, const QSize& previousSize, const QSize& newSize) UBPageSizeUndoCommand::UBPageSizeUndoCommand(UBGraphicsScene* pScene, const QSize& previousSize, const QSize& newSize)
: mScene(pScene) : mScene(pScene)

@ -7,6 +7,8 @@
#include "UBResizableGraphicsItem.h" #include "UBResizableGraphicsItem.h"
#include "core/memcheck.h"
UBResizableGraphicsItem::UBResizableGraphicsItem() UBResizableGraphicsItem::UBResizableGraphicsItem()
{ {
// NOOP // NOOP

@ -21,6 +21,8 @@
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "core/memcheck.h"
bool UBW3CWidget::sTemplateLoaded = false; bool UBW3CWidget::sTemplateLoaded = false;
QMap<QString, QString> UBW3CWidget::sNPAPIWrapperTemplates; QMap<QString, QString> UBW3CWidget::sNPAPIWrapperTemplates;
QString UBW3CWidget::sNPAPIWrappperConfigTemplate; QString UBW3CWidget::sNPAPIWrappperConfigTemplate;

@ -7,6 +7,8 @@
#include "UBBase32.h" #include "UBBase32.h"
#include "core/memcheck.h"
QString UBBase32::sBase32Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; QString UBBase32::sBase32Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
int UBBase32::sBase32Lookup[] = int UBBase32::sBase32Lookup[] =

@ -7,9 +7,12 @@
#include "UBCoreGraphicsScene.h" #include "UBCoreGraphicsScene.h"
#include "core/memcheck.h"
UBCoreGraphicsScene::UBCoreGraphicsScene(QObject * parent) UBCoreGraphicsScene::UBCoreGraphicsScene(QObject * parent)
: QGraphicsScene ( parent ) : QGraphicsScene ( parent )
{ {
int a = 13;
//NOOP //NOOP
} }
@ -18,7 +21,7 @@ UBCoreGraphicsScene::~UBCoreGraphicsScene()
//we must delete removed items that are no more in any scene //we must delete removed items that are no more in any scene
foreach (const QGraphicsItem* item, mItemsToDelete) foreach (const QGraphicsItem* item, mItemsToDelete)
{ {
if (!item->scene() && !(item->scene() == this)) if (item->scene()==NULL || item->scene() == this)
{ {
delete item; delete item;
} }

@ -9,6 +9,8 @@
#include <openssl/aes.h> #include <openssl/aes.h>
#include "core/memcheck.h"
UBCryptoUtils* UBCryptoUtils::sInstance(0); UBCryptoUtils* UBCryptoUtils::sInstance(0);
QString UBCryptoUtils::sAESKey("9ecHaspud9uD9ste5erAchehefrup3echej-caje6&thestawacuk=h#F3jet3aF"); QString UBCryptoUtils::sAESKey("9ecHaspud9uD9ste5erAchehefrup3echej-caje6&thestawacuk=h#F3jet3aF");
QString UBCryptoUtils::sAESSalt("6f0083e0-a90c-11de-ac21-0002a5d5c51b"); QString UBCryptoUtils::sAESSalt("6f0083e0-a90c-11de-ac21-0002a5d5c51b");

@ -1,5 +1,6 @@
#include "UBDesktopServices.h" #include "UBDesktopServices.h"
#include "core/memcheck.h"
QString UBDesktopServices::storageLocation(StandardLocation type) QString UBDesktopServices::storageLocation(StandardLocation type)
{ {

@ -14,6 +14,8 @@
#include <openssl/md5.h> #include <openssl/md5.h>
#include "core/memcheck.h"
QStringList UBFileSystemUtils::sTempDirToCleanUp; QStringList UBFileSystemUtils::sTempDirToCleanUp;

@ -7,6 +7,8 @@
#include "UBGeometryUtils.h" #include "UBGeometryUtils.h"
#include "core/memcheck.h"
const double PI = 4.0 * atan(1.0); const double PI = 4.0 * atan(1.0);
UBGeometryUtils::UBGeometryUtils() UBGeometryUtils::UBGeometryUtils()

@ -1,10 +1,11 @@
#include "UBPlatformUtils.h" #include "UBPlatformUtils.h"
#include "core/memcheck.h"
void UBPlatformUtils::destroy() void UBPlatformUtils::destroy()
{ {
initializeKeyboardLayouts(); destroyKeyboardLayouts();
} }
UBPlatformUtils::UBPlatformUtils() UBPlatformUtils::UBPlatformUtils()

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save