Commit 652d966e authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

Memory leaks fixing

parent 73b81093
......@@ -41,6 +41,8 @@
#include <QDomDocument>
#include "core/memcheck.h"
//enum of xmlparse status
//tag names definition
......
......@@ -18,7 +18,6 @@
#include "core/UBApplication.h"
#include "core/UBPersistenceManager.h"
#include "core/UBDocumentManager.h"
#include "core/memcheck.h"
#include "core/UBPersistenceManager.h"
#include "document/UBDocumentProxy.h"
#include "domain/UBGraphicsPDFItem.h"
......@@ -32,6 +31,8 @@
#include "quazipfile.h"
#include "quazipfileinfo.h"
#include "core/memcheck.h"
UBImportCFF::UBImportCFF(QObject *parent)
: UBImportAdaptor(parent)
{
......
......@@ -471,7 +471,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
{
if (annotationGroup)
{
annotationGroup->addPolygon(polygonItem);
polygonItem->setStroke(annotationGroup);
}
......@@ -492,7 +491,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
{
if (annotationGroup)
{
annotationGroup->addPolygon(polygonItem);
polygonItem->setStroke(annotationGroup);
}
......
......@@ -19,10 +19,10 @@
#include "adaptors/publishing/UBDocumentPublisher.h"
#include "core/memcheck.h"
#include "transition/UniboardSankoreTransition.h"
#include "core/memcheck.h"
UBWebPublisher::UBWebPublisher(QObject *parent)
: UBExportAdaptor(parent)
{
......
......@@ -43,9 +43,10 @@
#include "UBSvgSubsetRasterizer.h"
#include "core/memcheck.h"
#include "../../core/UBApplication.h"
#include "core/memcheck.h"
UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *parent)
: QObject(parent)
......
......@@ -33,6 +33,13 @@ UBDrawingController* UBDrawingController::drawingController()
return sDrawingController;
}
void UBDrawingController::destroy()
{
if(sDrawingController)
delete sDrawingController;
sDrawingController = NULL;
}
UBDrawingController::UBDrawingController(QObject * parent)
: QObject(parent)
, mActiveRuler(NULL)
......
......@@ -33,6 +33,7 @@ class UBDrawingController : public QObject
public:
static UBDrawingController* drawingController();
static void destroy();
int stylusTool();
int latestDrawingTool();
......
......@@ -476,7 +476,9 @@ QList<UBLibElement*> UBLibraryController::getContent(UBLibElement *element)
UBLibraryController::~UBLibraryController()
{
cleanElementsList();
//NOOP
qDeleteAll(mInternalLibElements);
mInternalLibElements.clear();
}
void UBLibraryController::setItemAsBackground(UBLibElement* image)
......@@ -778,6 +780,7 @@ UBChainedLibElement::~UBChainedLibElement()
delete mpNextElem;
mpNextElem = NULL;
}
delete mpElem;
}
void UBChainedLibElement::setNextElement(UBChainedLibElement *nextElem)
......
......@@ -43,7 +43,7 @@ public:
UBLibElement();
UBLibElement(eUBLibElementType type, const QUrl& path, const QString& name);
UBLibElement(UBLibElement* element);
~UBLibElement();
virtual ~UBLibElement();
static UBLibElement* trashElement();
......@@ -79,7 +79,7 @@ class UBChainedLibElement
{
public:
UBChainedLibElement(UBLibElement* pElem, UBChainedLibElement* pNextElem=NULL);
~UBChainedLibElement();
virtual ~UBChainedLibElement();
UBChainedLibElement* nextElement(){return mpNextElem;}
UBChainedLibElement* lastElement();
......
......@@ -53,6 +53,9 @@
#include "ui_mainWindow.h"
#include "frameworks/UBCryptoUtils.h"
#include "tools/UBToolsManager.h"
#include "core/memcheck.h"
QPointer<QUndoStack> UBApplication::undoStack;
......@@ -182,21 +185,26 @@ UBApplication::~UBApplication()
UBFileSystemUtils::deleteAllTempDirCreatedDuringSession();
// delete mainWindow;
delete mainWindow;
mainWindow = 0;
// delete staticMemoryCleaner;
staticMemoryCleaner = 0;
delete mUniboardSankoreTransition;
mUniboardSankoreTransition = 0;
if (mPreferencesController)
{
delete mPreferencesController;
mPreferencesController = 0;
}
UBPersistenceManager::destroy();
UBDownloadManager::destroy();
UBDrawingController::destroy();
UBSettings::destroy();
UBCryptoUtils::destroy();
UBToolsManager::destroy();
delete staticMemoryCleaner;
staticMemoryCleaner = 0;
}
int UBApplication::exec(const QString& pFileToImport)
......
......@@ -37,9 +37,10 @@
#include "UBSettings.h"
#include "UBPersistenceManager.h"
#include "core/memcheck.h"
#include "../adaptors/UBExportWeb.h"
#include "core/memcheck.h"
UBDocumentManager* UBDocumentManager::sDocumentManager = 0;
UBDocumentManager* UBDocumentManager::documentManager()
......
......@@ -18,6 +18,8 @@
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#include "core/memcheck.h"
/** The unique instance of the download manager */
static UBDownloadManager* pInstance = NULL;
......@@ -55,6 +57,15 @@ UBDownloadManager* UBDownloadManager::downloadManager()
return pInstance;
}
void UBDownloadManager::destroy()
{
if(pInstance)
{
delete pInstance;
}
pInstance = NULL;
}
/**
* \brief Add a file to the download list
* @param desc as the given file description
......
......@@ -63,15 +63,14 @@ class UBDownloadManager : public QObject
{
Q_OBJECT
public:
UBDownloadManager(QObject* parent=0, const char* name="UBDownloadManager");
~UBDownloadManager();
static UBDownloadManager* downloadManager();
void addFileToDownload(sDownloadFileDesc desc);
QVector<sDownloadFileDesc> currentDownloads();
QVector<sDownloadFileDesc> pendingDownloads();
void cancelDownloads();
static void destroy();
signals:
void fileAddedToDownload();
void downloadUpdated(int id, qint64 crnt, qint64 total);
......@@ -89,6 +88,9 @@ private slots:
void onDownloadError(int id);
private:
UBDownloadManager(QObject* parent=0, const char* name="UBDownloadManager");
~UBDownloadManager();
void init();
void updateDownloadOrder();
void updateFileCurrentSize(int id, qint64 received=-1, qint64 total=-1);
......
......@@ -20,6 +20,8 @@
#include "UBDownloadThread.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent object
......
......@@ -68,6 +68,13 @@ UBPersistenceManager* UBPersistenceManager::persistenceManager()
return sSingleton;
}
void UBPersistenceManager::destroy()
{
if (sSingleton)
delete sSingleton;
sSingleton = NULL;
}
UBPersistenceManager::~UBPersistenceManager()
{
foreach(QPointer<UBDocumentProxy> proxyGuard, documentProxies)
......
......@@ -58,6 +58,7 @@ class UBPersistenceManager : public QObject
static const QString widgetDirectory;
static UBPersistenceManager* persistenceManager();
static void destroy();
virtual UBDocumentProxy* createDocument(const QString& pGroupName = "", const QString& pName = "");
virtual UBDocumentProxy* createDocumentFromDir(const QString& pDocumentDirectory);
......
......@@ -97,6 +97,23 @@ QString UBSettings::appPingMessage = "__uniboard_ping";
QString UBSettings::defaultDocumentGroupName;
QString UBSettings::documentTrashGroupName;
UBSettings* UBSettings::settings()
{
if (!sSingleton)
sSingleton = new UBSettings(qApp);
return sSingleton;
}
void UBSettings::destroy()
{
if (sSingleton)
delete sSingleton;
sSingleton = NULL;
}
QSettings* UBSettings::getAppSettings()
{
if (!UBSettings::sAppSettings)
......
......@@ -22,13 +22,8 @@ class UBSettings : public QObject
public:
static UBSettings* settings()
{
if (!sSingleton)
sSingleton = new UBSettings(qApp);
return sSingleton;
}
static UBSettings* settings();
static void destroy();
private:
......
......@@ -21,6 +21,8 @@
#include "UBApplication.h"
#include "UBSettings.h"
/* Uncomment this for memory leaks detection */
/*
#if defined(WIN32) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
......@@ -28,7 +30,7 @@
#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
......
......@@ -100,6 +100,7 @@ void UBGraphicsItemDelegate::init()
UBGraphicsItemDelegate::~UBGraphicsItemDelegate()
{
qDeleteAll(mButtons);
// do not release mMimeData.
// the mMimeData is owned by QDrag since the setMimeData call as specified in the documentation
}
......
......@@ -53,25 +53,29 @@ UBGraphicsPolygonItem::UBGraphicsPolygonItem (const QLineF& pLine, qreal pWidth)
// NOOP
}
UBGraphicsPolygonItem::~UBGraphicsPolygonItem()
void UBGraphicsPolygonItem::clearStroke()
{
if (mStroke!=NULL)
{
QList<UBGraphicsPolygonItem*> pp = mStroke->polygons();
int n = pp.indexOf(this);
if (n>=0)
pp.removeAt(n);
if (pp.empty())
delete mStroke;
mStroke->remove(this);
if (mStroke->polygons().empty())
delete mStroke;
mStroke = NULL;
}
}
UBGraphicsPolygonItem::~UBGraphicsPolygonItem()
{
clearStroke();
}
void UBGraphicsPolygonItem::setStroke(UBGraphicsStroke* stroke)
{
mStroke = stroke;
clearStroke();
mStroke = stroke;
mStroke->addPolygon(this);
}
UBGraphicsStroke* UBGraphicsPolygonItem::stroke() const
......
......@@ -116,6 +116,9 @@ class UBGraphicsPolygonItem : public QGraphicsPolygonItem, public UBItem
private:
void clearStroke();
bool mHasAlpha;
QLineF mOriginalLine;
......
......@@ -141,8 +141,11 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
UBGraphicsScene::~UBGraphicsScene()
{
// NOOP
DisposeMagnifierQWidgets();
if (mCurrentStroke)
if (mCurrentStroke->polygons().empty())
delete mCurrentStroke;
}
void UBGraphicsScene::selectionChangedProcessing()
......@@ -190,6 +193,12 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre
if (UBDrawingController::drawingController()->isDrawingTool())
{
qreal width = 0;
// delete current stroke, if not assigned to any polygon
if (mCurrentStroke)
if (mCurrentStroke->polygons().empty())
delete mCurrentStroke;
mCurrentStroke = new UBGraphicsStroke();
if (currentTool != UBStylusTool::Line)
......@@ -344,7 +353,12 @@ bool UBGraphicsScene::inputDeviceRelease()
UBDrawingController *dc = UBDrawingController::drawingController();
if (dc->isDrawingTool())
{
mCurrentStroke = 0;
if (mCurrentStroke)
{
if (mCurrentStroke->polygons().empty())
delete mCurrentStroke;
mCurrentStroke = 0;
}
}
if (mRemovedItems.size() > 0 || mAddedItems.size() > 0)
......@@ -503,7 +517,6 @@ void UBGraphicsScene::drawLineTo(const QPointF &pEndPoint, const qreal &pWidth,
if (mCurrentStroke)
{
mCurrentStroke->addPolygon(polygonItem);
polygonItem->setStroke(mCurrentStroke);
}
......
......@@ -33,9 +33,16 @@ UBGraphicsStroke::~UBGraphicsStroke()
void UBGraphicsStroke::addPolygon(UBGraphicsPolygonItem* pol)
{
remove(pol);
mPolygons << pol;
}
void UBGraphicsStroke::remove(UBGraphicsPolygonItem* polygonItem)
{
int n = mPolygons.indexOf(polygonItem);
if (n>=0)
mPolygons.removeAt(n);
}
QList<UBGraphicsPolygonItem*> UBGraphicsStroke::polygons() const
{
......
......@@ -25,20 +25,25 @@ class UBGraphicsPolygonItem;
class UBGraphicsStroke
{
friend class UBGraphicsPolygonItem;
public:
UBGraphicsStroke();
virtual ~UBGraphicsStroke();
bool hasPressure();
void addPolygon(UBGraphicsPolygonItem* pol);
QList<UBGraphicsPolygonItem*> polygons() const;
void remove(UBGraphicsPolygonItem* polygonItem);
UBGraphicsStroke *deepCopy();
bool hasAlpha() const;
protected:
void addPolygon(UBGraphicsPolygonItem* pol);
private:
QList<UBGraphicsPolygonItem*> mPolygons;
......
......@@ -23,6 +23,21 @@ UBCryptoUtils* UBCryptoUtils::sInstance(0);
QString UBCryptoUtils::sAESKey("9ecHaspud9uD9ste5erAchehefrup3echej-caje6&thestawacuk=h#F3jet3aF");
QString UBCryptoUtils::sAESSalt("6f0083e0-a90c-11de-ac21-0002a5d5c51b");
UBCryptoUtils* UBCryptoUtils::instance()
{
if(!sInstance)
sInstance = new UBCryptoUtils(UBApplication::staticMemoryCleaner);
return sInstance;
}
void UBCryptoUtils::destroy()
{
if (sInstance)
delete sInstance;
sInstance = NULL;
}
UBCryptoUtils::UBCryptoUtils(QObject * pParent)
: QObject(pParent)
......
......@@ -28,13 +28,9 @@ class UBCryptoUtils : public QObject
public:
static UBCryptoUtils* instance()
{
if(!sInstance)
sInstance = new UBCryptoUtils(UBApplication::staticMemoryCleaner);
static UBCryptoUtils* instance();
static void destroy();
return sInstance;
}
QString symetricEncrypt(const QString& clear);
QString symetricDecrypt(const QString& encrypted);
......
......@@ -19,6 +19,8 @@
#include <QtCore/qglobal.h>
#include <QDesktopServices>
#include "core/memcheck.h"
// TODO Qt 4.6 #error Delete this UBDesktopServices class,
// it was used to work around a bug in Qt 4.4 that was fixed in Qt 4.5 and another that should be fixed
// in 4.5.1
......
......@@ -10,6 +10,8 @@
#include "board/UBBoardController.h"
#include "domain/UBGraphicsScene.h"
#include "core/memcheck.h"
static QVector<UBGraphicsCache*> mCaches;
UBCachePropertiesWidget::UBCachePropertiesWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent)
......
#include "UBDockPaletteWidget.h"
#include "core/memcheck.h"
UBDockPaletteWidget::UBDockPaletteWidget(QWidget *parent, const char *name):QWidget(parent)
{
setObjectName(name);
......
......@@ -20,6 +20,8 @@
#include "UBDownloadWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
......
......@@ -15,6 +15,8 @@
#include "UBLeftPalette.h"
#include "core/UBSettings.h"
#include "core/memcheck.h"
/**
* \brief The constructor
*/
......
......@@ -143,8 +143,9 @@ void UBLibNavigatorWidget::removeNextChainedElements(UBChainedLibElement *fromEl
{
if(NULL != fromElem->nextElement())
{
removeNextChainedElements(fromElem->nextElement());
delete fromElem->nextElement()->element();
//removeNextChainedElements(fromElem->nextElement());
//delete fromElem->nextElement()->element();
//delete fromElem->nextElement();
delete fromElem->nextElement();
fromElem->setNextElement(NULL);
}
......
......@@ -80,16 +80,16 @@ UBLibPathViewer::~UBLibPathViewer()
delete mpElems;
mpElems = NULL;
}
if(NULL != mpElemsBackup)
{
delete mpElemsBackup;
mpElemsBackup = NULL;
}
if(NULL != mpLayout)
{
delete mpLayout;
mpLayout = NULL;
}
//if(NULL != mpElemsBackup)
//{
// delete mpElemsBackup;
// mpElemsBackup = NULL;
//}
//if(NULL != mpLayout)
//{
// delete mpLayout;
// mpLayout = NULL;
//}
if(NULL != mpScene)
{
delete mpScene;
......
......@@ -4,6 +4,8 @@
#include "UBLibWebView.h"
#include "core/memcheck.h"
UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent)
, mpView(NULL)
, mpWebSettings(NULL)
......
......@@ -15,9 +15,10 @@
#include <QDebug>
#include "UBLibWidget.h"
#include "core/memcheck.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
......
......@@ -24,11 +24,12 @@
#include "board/UBBoardController.h"
#include "board/UBLibraryController.h"
#include "core/memcheck.h"
#include "core/UBDownloadManager.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
......@@ -55,12 +56,6 @@ UBLibraryWidget::~UBLibraryWidget()
delete mLibraryController;
mLibraryController = NULL;
}
// if(NULL != chainedElements)
// {
// delete chainedElements;
// chainedElements = NULL;
// }
if(NULL != mpCrntDir)
{
delete mpCrntDir;
......
......@@ -20,6 +20,8 @@
#include "board/UBBoardController.h"
#include "domain/UBGraphicsScene.h"
#include "core/memcheck.h"
UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive)
: QWidget(parent, parent ? Qt::Widget : Qt::Tool | (Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint))
......
......@@ -17,6 +17,8 @@
#include "UBRightPalette.h"
#include "core/memcheck.h"
/**
* \brief The constructor
*/
......
......@@ -26,17 +26,20 @@
UBRubberBand::UBRubberBand(Shape s, QWidget * p)
: QRubberBand(s, p)
{
QStyle* rubberBandStyle = QRubberBand::style();
customStyle = NULL;
#ifdef Q_WS_WIN
rubberBandStyle = new QWindowsXPStyle();
customStyle = new QWindowsXPStyle();
#elif defined(Q_WS_MAC)
rubberBandStyle = new QMacStyle();
customStyle = new QMacStyle();
#endif
QRubberBand::setStyle(rubberBandStyle);
if (customStyle)
QRubberBand::setStyle(customStyle);
}
UBRubberBand::~UBRubberBand()
{
// NOOP
if (customStyle)
delete customStyle;
}
......@@ -25,6 +25,8 @@ class UBRubberBand : public QRubberBand
public:
UBRubberBand(Shape s, QWidget * p = 0);
virtual ~UBRubberBand();
private:
QStyle* customStyle;
};
#endif /* UBRUBBERBAND_H_ */
......@@ -9,6 +9,8 @@
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#include "core/memcheck.h"
UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent)
, mpLayout(NULL)
, mpTitleLayout(NULL)
......
......@@ -21,11 +21,11 @@
#include "core/UBSettings.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "document/UBDocumentProxy.h"
#include "document/UBDocumentController.h"
#include "core/memcheck.h"
UBThumbnailWidget::UBThumbnailWidget(QWidget* parent)
: QGraphicsView(parent)
, mThumbnailWidth(UBSettings::defaultThumbnailWidth)
......
......@@ -15,6 +15,9 @@
#include <iostream>
#include "ASCII85Decode.h"
#include "core/memcheck.h"
using namespace merge_lib;
static const unsigned long pow85[] = {
85*85*85*85, 85*85*85, 85*85, 85, 1
......
......@@ -17,6 +17,8 @@
#include <string>
#include "Utils.h"
#include "core/memcheck.h"
using namespace merge_lib;
const std::string WHITESPACES(" \t\f\v\n\r");
......
......@@ -14,6 +14,8 @@
*/
#include "AnnotsHandler.h"
#include "core/memcheck.h"
using namespace merge_lib;
void AnnotsHandler::_processObjectContent(unsigned int startOfPageElement)
{
......
......@@ -21,6 +21,8 @@
#include <string>
#include <string.h>
#include "core/memcheck.h"
using namespace merge_lib;
using namespace std;
//concatenate stream of all objects which contain Content of Page
......
......@@ -23,6 +23,8 @@
#include <iostream>
#include <iomanip>
#include "core/memcheck.h"
using namespace merge_lib;
const std::string firstObj("%PDF-1.4\n1 0 obj\n<<\n/Title ()/Creator ()/Producer (Qt 4.5.0 (C) 1992-2009 Nokia Corporation and/or its subsidiary(-ies))/CreationDate (D:20090424120829)\n>>\nendobj\n");
const std::string zeroStr("0000000000");
......
......@@ -24,6 +24,8 @@
#include "JBIG2Decode.h"
#include "DCTDecode.h"
#include "core/memcheck.h"
using namespace merge_lib;
std::map<std::string, Decoder *> Filter::_allDecoders;
......
......@@ -21,6 +21,8 @@
#include "Object.h"
#include "Parser.h"
#include "core/memcheck.h"
using namespace merge_lib;
const std::string FilterPredictor::PREDICTOR_TOKEN = "/Predictor";
......
......@@ -19,6 +19,8 @@
#include "Utils.h"
#include <string.h>
#include "core/memcheck.h"
using namespace merge_lib;
#define ZLIB_MEM_DELTA 65535
#define ZLIB_CHECK_ERR(err,msg) \
......
......@@ -16,6 +16,8 @@
#include "LZWDecode.h"
#include "FilterPredictor.h"
#include "core/memcheck.h"
// method performs decoding
using namespace merge_lib;
......
......@@ -21,6 +21,8 @@
#include <map>
#include <iostream>
#include "core/memcheck.h"
using namespace merge_lib;
Parser Merger::_parser;
......
......@@ -19,6 +19,8 @@
#include <algorithm>
#include <fstream>
#include "core/memcheck.h"
using namespace merge_lib;
std::string NUMBERANDWHITESPACE(" 0123456789");
......
......@@ -18,6 +18,8 @@
#include "Exception.h"
#include "Object.h"
#include "core/memcheck.h"
using namespace merge_lib;
using namespace std;
......
......@@ -32,6 +32,8 @@
#include <string.h>
#include "Parser.h"
#include "core/memcheck.h"
using namespace merge_lib;
......
......@@ -14,6 +14,8 @@
*/
#include "PageElementHandler.h"
#include "core/memcheck.h"
using namespace merge_lib;
std::set<std::string> PageElementHandler::_allPageFields;
......
......@@ -23,6 +23,8 @@
#include "Exception.h"
#include "Utils.h"
#include "core/memcheck.h"
using namespace merge_lib;
using namespace std;
......
......@@ -19,6 +19,8 @@
#include <iostream>
#include "core/memcheck.h"
using namespace merge_lib;
Rectangle::Rectangle(const char * rectangleName):
......
......@@ -14,6 +14,8 @@
*/
#include "RemoveHimSelfHandler.h"
#include "core/memcheck.h"
using namespace merge_lib;
void RemoveHimselfHandler::_changeObjectContent(unsigned int startOfPageElement)
......
......@@ -14,6 +14,8 @@
*/
#include "RunLengthDecode.h"
#include "core/memcheck.h"
using namespace merge_lib;
/* The encoded data is a sequence of
......
......@@ -21,6 +21,8 @@
#include <fstream>
#include <string.h>
#include "core/memcheck.h"
using namespace merge_lib;
int Utils::stringToInt(const std::string & str) //throw ConvertException
......
......@@ -15,6 +15,8 @@
#include "UBAbstractVideoEncoder.h"
#include "core/memcheck.h"
UBAbstractVideoEncoder::UBAbstractVideoEncoder(QObject *pParent)
: QObject(pParent)
, mFramesPerSecond(10)
......
......@@ -53,6 +53,7 @@
#include "quicktime/UBAudioQueueRecorder.h"
#endif
#include "core/memcheck.h"
UBPodcastController* UBPodcastController::sInstance = 0;
......
......@@ -25,6 +25,7 @@
#include "gui/UBMainWindow.h"
#include "core/memcheck.h"
UBPodcastRecordingPalette::UBPodcastRecordingPalette(QWidget *parent)
: UBActionPalette(Qt::Horizontal, parent)
......
......@@ -28,6 +28,8 @@
#include "gui/UBMainWindow.h"
#include "core/memcheck.h"
UBIntranetPodcastPublisher::UBIntranetPodcastPublisher(QObject* pParent)
: QObject(pParent)
......
......@@ -15,6 +15,7 @@
#include "UBAudioQueueRecorder.h"
#include "core/memcheck.h"
AudioStreamBasicDescription UBAudioQueueRecorder::sAudioFormat;
......
......@@ -22,6 +22,8 @@
#include "UBAudioQueueRecorder.h"
#include <QtGui>
#include "core/memcheck.h"
QQueue<UBQuickTimeFile::VideoFrame> UBQuickTimeFile::frameQueue;
QMutex UBQuickTimeFile::frameQueueMutex;
QWaitCondition UBQuickTimeFile::frameBufferNotEmpty;
......
......@@ -28,6 +28,7 @@
#include "UBQuickTimeFile.h"
#include "core/memcheck.h"
UBQuickTimeVideoEncoder::UBQuickTimeVideoEncoder(QObject* pParent)
: UBAbstractVideoEncoder(pParent)
......
......@@ -17,6 +17,8 @@
#include "Mmsystem.h"
#include "core/memcheck.h"
UBWaveRecorder::UBWaveRecorder(QObject * pParent)
: QObject(pParent)
, mIsRecording(false)
......
......@@ -19,6 +19,8 @@
#include "core/UBApplication.h"
#include "core/memcheck.h"
UBWindowsMediaFile::UBWindowsMediaFile(QObject * pParent)
: QObject(pParent)
, mWMhDC(0)
......
......@@ -24,6 +24,7 @@
#include "UBWindowsMediaFile.h"
#include "core/memcheck.h"
UBWindowsMediaVideoEncoder::UBWindowsMediaVideoEncoder(QObject* pParent)
: UBAbstractVideoEncoder(pParent)
......
......@@ -29,6 +29,8 @@
#include "network/UBNetworkAccessManager.h"
#include "network/UBServerXMLHttpRequest.h"
#include "core/memcheck.h"
// API key linked to account dev.mnemis@gmail.com
const QString UBYouTubePublisher::sYouTubeDeveloperKey("AI39si62ga82stA4YBr5JjkfuRsFT-QyC4UYsFn7yYQFMe_dzg8xOc0r91BOhxSEhEr0gdWJGNnDsYbv9wvpyROd2Yre-6Zh7g");
......
......@@ -18,6 +18,8 @@
#include "UBRssHandler.h"
#include "UBSoftwareUpdate.h"
#include "core/memcheck.h"
const QString UBRssHandler::sRssItemElementName = "item";
const QString UBRssHandler::sRssLinkElementName = "link";
const QString UBRssHandler::sUniboardVersionElementName = "ub:version"; // TODO UB 4.x map properly ub namespace
......
......@@ -17,6 +17,8 @@
#include "UBSoftwareUpdate.h"
#include "core/memcheck.h"
UBSoftwareUpdate::UBSoftwareUpdate()
{
// NOOP
......
......@@ -22,6 +22,7 @@
#include "board/UBBoardView.h"
#include "domain/UBGraphicsScene.h"
#include "core/memcheck.h"
UBGraphicsCache::UBGraphicsCache():QGraphicsRectItem()
, mMaskColor(Qt::black)
......
......@@ -19,6 +19,21 @@
UBToolsManager* UBToolsManager::sManager = 0;
UBToolsManager* UBToolsManager::manager()
{
if (!sManager)
sManager = new UBToolsManager(UBApplication::staticMemoryCleaner);
return sManager;
}
void UBToolsManager::destroy()
{
if (sManager)
delete sManager;
sManager = NULL;
}
UBToolsManager::UBToolsManager(QObject *parent)
: QObject(parent)
{
......
......@@ -38,12 +38,8 @@ class UBToolsManager : public QObject
};
static UBToolsManager* manager()
{
if (!sManager)
sManager = new UBToolsManager(UBApplication::staticMemoryCleaner);
return sManager;
}
static UBToolsManager* manager();
static void destroy();
QList<UBToolDescriptor> allTools()
{
......
......@@ -20,6 +20,8 @@
#include "core/UBApplication.h"
#include "core/UBPersistenceManager.h"
#include "core/memcheck.h"
UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) :
QObject(parent)
, mTransitionDlg(NULL)
......
......@@ -19,6 +19,8 @@
#include <QtWebKit>
#include <QtGui>
#include "core/memcheck.h"
UBRoutedMouseEventWebView::UBRoutedMouseEventWebView(QWidget * parent)
: QWebView(parent)
{
......
......@@ -33,6 +33,7 @@
#include "ui_trapFlash.h"
#include "core/memcheck.h"
UBTrapFlashController::UBTrapFlashController(QWidget* parent)
: QObject(parent)
......
......@@ -48,6 +48,7 @@
#include "desktop/UBCustomCaptureWindow.h"
#include "board/UBBoardPaletteManager.h"
#include "core/memcheck.h"
UBWebController::UBWebController(UBMainWindow* mainWindow)
: QObject(mainWindow->centralWidget())
......
......@@ -15,6 +15,8 @@
#include "UBWebKitUtils.h"
#include "core/memcheck.h"
UBWebKitUtils::UBWebKitUtils()
{
// NOOP
......
......@@ -20,6 +20,8 @@
#include "pdf/UBWebPluginPDFWidget.h"
#include "core/memcheck.h"
class UBWebPluginFactory : public QWebPluginFactory
{
public:
......
......@@ -18,6 +18,8 @@
#include "pdf/UBWebPluginPDFWidget.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
UBWebPluginWidget::UBWebPluginWidget(const QUrl &url, QWidget *parent)
: QWidget(parent)
, mLoadingProgressBar(this)
......
......@@ -78,6 +78,7 @@
#include "ui_passworddialog.h"
#include "WBWebView.h"
#include "core/memcheck.h"
WBDownloadManager *WBBrowserWindow::sDownloadManager = 0;
WBHistoryManager *WBBrowserWindow::sHistoryManager = 0;
......
......@@ -57,6 +57,8 @@
#include <QtGui>
#include "core/memcheck.h"
WBChaseWidget::WBChaseWidget(QWidget *parent, QPixmap pixmap, bool pixmapEnabled)
: QWidget(parent)
, mSegment(0)
......
......@@ -66,6 +66,8 @@
#include <math.h>
#include "core/memcheck.h"
/*!
DownloadItem is a widget that is displayed in the download manager list.
It moves the data from the QNetworkReply into the QFile as well
......
......@@ -56,6 +56,8 @@
#include "WBEditTableView.h"
#include <QtGui/QKeyEvent>
#include "core/memcheck.h"
WBEditTableView::WBEditTableView(QWidget *parent)
: QTableView(parent)
{
......
......@@ -63,6 +63,7 @@
#include "core/UBSettings.h"
#include "network/UBAutoSaver.h"
#include "core/memcheck.h"
static const unsigned int HISTORY_VERSION = 23;
......
......@@ -57,6 +57,8 @@
#include <QtCore>
#include "core/memcheck.h"
WBModelMenu::WBModelMenu(QWidget * parent)
: QMenu(parent)
, m_maxRows(7)
......
......@@ -57,6 +57,8 @@
#include <QtGui>
#include "core/memcheck.h"
WBClearButton::WBClearButton(QWidget *parent)
: QAbstractButton(parent)
{
......
......@@ -55,6 +55,8 @@
#include "WBSqueezeLabel.h"
#include "core/memcheck.h"
WBSqueezeLabel::WBSqueezeLabel(QWidget *parent) : QLabel(parent)
{
}
......
......@@ -66,6 +66,8 @@
#include <QtGui>
#include <QSvgWidget>
#include "core/memcheck.h"
WBTabBar::WBTabBar(QWidget *parent)
: QTabBar(parent)
{
......
......@@ -60,6 +60,8 @@
#include "network/UBAutoSaver.h"
#include "core/memcheck.h"
/*
ToolbarSearch is a very basic search widget that also contains a small history.
Searches are turned into urls that use Google to perform search
......
......@@ -60,6 +60,8 @@
#include <QtGui>
#include "core/memcheck.h"
WBExLineEdit::WBExLineEdit(QWidget *parent)
: QWidget(parent)
, mLeftWidget(0)
......
......@@ -24,6 +24,8 @@
#include "core/UBApplicationController.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
WBWebTrapWebView::WBWebTrapWebView(QWidget* parent)
: QWebView(parent)
, mCurrentContentType(Unknown)
......
......@@ -70,6 +70,7 @@
#include <QtWebKit>
#include <QtUiTools/QUiLoader>
#include "core/memcheck.h"
WBWebPage::WBWebPage(QObject *parent)
: UBWebPage(parent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment