Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Ivan Ilin 13 years ago
commit 5aebe0cf92
  1. 2
      src/adaptors/UBCFFSubsetAdaptor.cpp
  2. 3
      src/adaptors/UBImportCFF.cpp
  3. 2
      src/adaptors/UBSvgSubsetAdaptor.cpp
  4. 4
      src/adaptors/UBWebPublisher.cpp
  5. 3
      src/adaptors/publishing/UBDocumentPublisher.cpp
  6. 7
      src/board/UBDrawingController.cpp
  7. 1
      src/board/UBDrawingController.h
  8. 25
      src/board/UBLibraryController.cpp
  9. 6
      src/board/UBLibraryController.h
  10. 33
      src/core/UBApplication.cpp
  11. 3
      src/core/UBDocumentManager.cpp
  12. 21
      src/core/UBDownloadManager.cpp
  13. 9
      src/core/UBDownloadManager.h
  14. 2
      src/core/UBDownloadThread.cpp
  15. 7
      src/core/UBPersistenceManager.cpp
  16. 1
      src/core/UBPersistenceManager.h
  17. 17
      src/core/UBSettings.cpp
  18. 9
      src/core/UBSettings.h
  19. 4
      src/core/main.cpp
  20. 1
      src/domain/UBGraphicsItemDelegate.cpp
  21. 20
      src/domain/UBGraphicsPolygonItem.cpp
  22. 3
      src/domain/UBGraphicsPolygonItem.h
  23. 17
      src/domain/UBGraphicsScene.cpp
  24. 7
      src/domain/UBGraphicsStroke.cpp
  25. 9
      src/domain/UBGraphicsStroke.h
  26. 15
      src/frameworks/UBCryptoUtils.cpp
  27. 8
      src/frameworks/UBCryptoUtils.h
  28. 2
      src/frameworks/UBDesktopServices.h
  29. 2
      src/gui/UBCachePropertiesWidget.cpp
  30. 2
      src/gui/UBDockPaletteWidget.cpp
  31. 2
      src/gui/UBDownloadWidget.cpp
  32. 2
      src/gui/UBLeftPalette.cpp
  33. 5
      src/gui/UBLibNavigatorWidget.cpp
  34. 20
      src/gui/UBLibPathViewer.cpp
  35. 2
      src/gui/UBLibWebView.cpp
  36. 3
      src/gui/UBLibWidget.cpp
  37. 42
      src/gui/UBLibraryWidget.cpp
  38. 2
      src/gui/UBLibraryWidget.h
  39. 2
      src/gui/UBMagnifer.cpp
  40. 2
      src/gui/UBRightPalette.cpp
  41. 13
      src/gui/UBRubberBand.cpp
  42. 2
      src/gui/UBRubberBand.h
  43. 2
      src/gui/UBTeacherBarWidget.cpp
  44. 4
      src/gui/UBThumbnailWidget.cpp
  45. 1
      src/network/UBNetworkAccessManager.cpp
  46. 3
      src/pdf-merger/ASCII85Decode.cpp
  47. 2
      src/pdf-merger/ASCIIHexDecode.cpp
  48. 2
      src/pdf-merger/AnnotsHandler.cpp
  49. 2
      src/pdf-merger/ContentHandler.cpp
  50. 2
      src/pdf-merger/Document.cpp
  51. 2
      src/pdf-merger/Filter.cpp
  52. 2
      src/pdf-merger/FilterPredictor.cpp
  53. 2
      src/pdf-merger/FlateDecode.cpp
  54. 2
      src/pdf-merger/LZWDecode.cpp
  55. 2
      src/pdf-merger/Merger.cpp
  56. 2
      src/pdf-merger/Object.cpp
  57. 2
      src/pdf-merger/OverlayDocumentParser.cpp
  58. 2
      src/pdf-merger/Page.cpp
  59. 2
      src/pdf-merger/PageElementHandler.cpp
  60. 2
      src/pdf-merger/Parser.cpp
  61. 2
      src/pdf-merger/Rectangle.cpp
  62. 2
      src/pdf-merger/RemoveHimselfHandler.cpp
  63. 2
      src/pdf-merger/RunLengthDecode.cpp
  64. 2
      src/pdf-merger/Utils.cpp
  65. 2
      src/podcast/UBAbstractVideoEncoder.cpp
  66. 1
      src/podcast/UBPodcastController.cpp
  67. 1
      src/podcast/UBPodcastRecordingPalette.cpp
  68. 2
      src/podcast/intranet/UBIntranetPodcastPublisher.cpp
  69. 1
      src/podcast/quicktime/UBAudioQueueRecorder.cpp
  70. 2
      src/podcast/quicktime/UBQuickTimeFile.cpp
  71. 1
      src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp
  72. 2
      src/podcast/windowsmedia/UBWaveRecorder.cpp
  73. 2
      src/podcast/windowsmedia/UBWindowsMediaFile.cpp
  74. 1
      src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp
  75. 2
      src/podcast/youtube/UBYouTubePublisher.cpp
  76. 2
      src/softwareupdate/UBRssHandler.cpp
  77. 2
      src/softwareupdate/UBSoftwareUpdate.cpp
  78. 1
      src/tools/UBGraphicsCache.cpp
  79. 15
      src/tools/UBToolsManager.cpp
  80. 8
      src/tools/UBToolsManager.h
  81. 2
      src/transition/UniboardSankoreTransition.cpp
  82. 2
      src/web/UBRoutedMouseEventWebView.cpp
  83. 1
      src/web/UBTrapFlashController.cpp
  84. 1
      src/web/UBWebController.cpp
  85. 2
      src/web/UBWebKitUtils.cpp
  86. 2
      src/web/UBWebPage.cpp
  87. 2
      src/web/UBWebPluginWidget.cpp
  88. 1
      src/web/browser/WBBrowserWindow.cpp
  89. 2
      src/web/browser/WBChaseWidget.cpp
  90. 2
      src/web/browser/WBDownloadManager.cpp
  91. 2
      src/web/browser/WBEditTableView.cpp
  92. 1
      src/web/browser/WBHistory.cpp
  93. 2
      src/web/browser/WBModelMenu.cpp
  94. 2
      src/web/browser/WBSearchLineEdit.cpp
  95. 2
      src/web/browser/WBSqueezeLabel.cpp
  96. 2
      src/web/browser/WBTabWidget.cpp
  97. 2
      src/web/browser/WBToolBarSearch.cpp
  98. 2
      src/web/browser/WBUrlLineEdit.cpp
  99. 2
      src/web/browser/WBWebTrapWebView.cpp
  100. 1
      src/web/browser/WBWebView.cpp

@ -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();

@ -23,6 +23,7 @@
#include "core/UBSettings.h"
#include "core/UBSetting.h"
#include "core/UBApplicationController.h"
#include "core/UBDownloadManager.h"
#include "domain/UBAbstractWidget.h"
#include "domain/UBGraphicsScene.h"
@ -110,7 +111,6 @@ void UBLibraryController::createDirectory(QUrl& pDirPath)
void UBLibraryController::routeItem(QString& pItem, QString pMiddleDirectory)
{
qDebug() << "routeItem: " << pItem;
QFileInfo itemToRoute(pItem);
QString mimetype = UBFileSystemUtils::mimeTypeFromFileName(itemToRoute.fileName());
QString destination("");
@ -138,6 +138,7 @@ void UBLibraryController::routeItem(QString& pItem, QString pMiddleDirectory)
createDirectory(url);
}
destination = UBFileSystemUtils::normalizeFilePath(destination + "/" + itemToRoute.fileName());
QFile::copy(pItem, destination);
}
}
@ -187,8 +188,25 @@ void UBLibraryController::importItemOnLibrary(QString& pItemString)
}
}
else{
if(pItemString.startsWith("uniboardTool://") || pItemString.startsWith("file://") || pItemString.startsWith("/"))
{
// The user dropped a local file
routeItem(pItemString);
}
else
{
// The user dropped a file from the web. We must download it.
sDownloadFileDesc desc;
desc.currentSize = 0;
desc.id = 0;
desc.isBackground = false;
desc.modal = false;
desc.name = QFileInfo(pItemString).fileName();
desc.totalSize = 0;
desc.url = pItemString;
UBDownloadManager::downloadManager()->addFileToDownload(desc);
}
}
}
@ -458,7 +476,9 @@ QList<UBLibElement*> UBLibraryController::getContent(UBLibElement *element)
UBLibraryController::~UBLibraryController()
{
cleanElementsList();
//NOOP
qDeleteAll(mInternalLibElements);
mInternalLibElements.clear();
}
void UBLibraryController::setItemAsBackground(UBLibElement* image)
@ -760,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();
@ -120,6 +120,7 @@ class UBLibraryController : public QObject
void createNewFolder(QString name, UBLibElement* parentElem);
bool canItemsOnElementBeDeleted(UBLibElement *pElement);
void routeItem(QString& pItem, QString pMiddleDirectory = QString());
signals:
void dialogClosed(int state);
@ -153,7 +154,6 @@ class UBLibraryController : public QObject
QList<UBLibElement*> addVirtualElementsForItemPath(const QString& pPath);
void createInternalWidgetItems();
void routeItem(QString& pItem, QString pMiddleDirectory = QString());
void createDirectory(QUrl& pDirPath);
QUrl mAudioStandardDirectoryPath;

@ -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)
@ -633,15 +641,14 @@ QString UBApplication::globalStyleSheet()
QString UBApplication::urlFromHtml(QString html)
{
qDebug() << "HTML: " << html.remove(QRegExp("[\\0]"));
QString url;
QDomDocument domDoc;
domDoc.setContent(html);
domDoc.setContent(html.remove(QRegExp("[\\0]")));
QDomElement rootElem = domDoc.documentElement();
url = rootElem.attribute("src");
qDebug() << url;
return url;
}

@ -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()

@ -15,6 +15,10 @@
#include "UBDownloadManager.h"
#include "core/UBApplication.h"
#include "gui/UBMainWindow.h"
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#include "core/memcheck.h"
/** The unique instance of the download manager */
static UBDownloadManager* pInstance = NULL;
@ -53,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
@ -73,6 +86,10 @@ void UBDownloadManager::addFileToDownload(sDownloadFileDesc desc)
updateDownloadOrder();
UBApplication::mainWindow->showDownloadWidget();
}
else
{
UBApplication::boardController->paletteManager()->startDownloads();
}
emit fileAddedToDownload();
}
@ -190,6 +207,10 @@ void UBDownloadManager::onDownloadFinished(int id, bool pSuccess, QUrl sourceUrl
// The downloaded file is modal so we must put it on the board
emit addDownloadedFileToBoard(pSuccess, sourceUrl, pContentTypeHeader, pData, pPos, pSize, isBackground);
}
else
{
emit addDownloadedFileToLibrary(pSuccess, sourceUrl, pContentTypeHeader, pData);
}
break;
}
}

@ -63,21 +63,21 @@ 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);
void downloadFinished(int id);
void downloadModalFinished();
void addDownloadedFileToBoard(bool pSuccess, QUrl sourceUrl, QString pContentTypeHeader, QByteArray pData, QPointF pPos, QSize pSize, bool isBackground);
void addDownloadedFileToLibrary(bool pSuccess, QUrl sourceUrl, QString pContentTypeHeader, QByteArray pData);
void cancelAllDownloads();
void allDownloadsFinished();
@ -88,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())
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,8 +353,13 @@ bool UBGraphicsScene::inputDeviceRelease()
UBDrawingController *dc = UBDrawingController::drawingController();
if (dc->isDrawingTool())
{
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)

@ -1,5 +1,7 @@
#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

@ -14,6 +14,7 @@
*/
#include <QList>
#include <QFileInfo>
#include <QDir>
#include "UBLibraryWidget.h"
#include "core/UBSettings.h"
@ -23,10 +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
@ -53,12 +56,6 @@ UBLibraryWidget::~UBLibraryWidget()
delete mLibraryController;
mLibraryController = NULL;
}
// if(NULL != chainedElements)
// {
// delete chainedElements;
// chainedElements = NULL;
// }
if(NULL != mpCrntDir)
{
delete mpCrntDir;
@ -87,6 +84,7 @@ void UBLibraryWidget::init()
connect(this, SIGNAL(mouseClick(QGraphicsItem*,int)), this, SLOT(onItemClicked(QGraphicsItem*,int)));
connect(this, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
connect(UBDownloadManager::downloadManager(), SIGNAL(addDownloadedFileToLibrary(bool,QUrl,QString,QByteArray)), this, SLOT(onAddDownloadedFileToLibrary(bool,QUrl,QString,QByteArray)));
}
/**
@ -362,7 +360,14 @@ void UBLibraryWidget::dropEvent(QDropEvent *event)
}
else if (pMimeData->hasHtml())
{
qDebug() << "hasHtml Unsupported yet";
qDebug() << "hasHtml";
QString html = pMimeData->html();
QString url = UBApplication::urlFromHtml(html);
if("" != url)
{
mLibraryController->importItemOnLibrary(url);
bDropAccepted = true;
}
}
else if (pMimeData->hasText())
{
@ -666,3 +671,24 @@ void UBNewFolderDlg::text_Edited(const QString &newText)
QToolTip::showText(mpLineEdit->mapToGlobal(QPoint()), "A file name can`t contain any of the following characters:\r\n"+illegalCharList);
}
}
void UBLibraryWidget::onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUrl, QString pContentHeader, QByteArray pData)
{
Q_UNUSED(pContentHeader);
if(pSuccess)
{
QDir dir;
dir.mkdir("tmp");
QString qsFileName = QFileInfo(sourceUrl.toString()).fileName();
QString qsFilePath = UBFileSystemUtils::normalizeFilePath(QString("tmp/%0").arg(qsFileName));
QFile f(qsFilePath);
if(f.open(QIODevice::WriteOnly))
{
f.write(pData);
f.close();
}
mLibraryController->routeItem(qsFilePath);
dir.remove(qsFileName);
dir.rmdir("tmp"); // Due to Qt, the directoy will be removed only if it's empty :)
}
}

@ -55,6 +55,8 @@ public slots:
void onSearchElement(QString elem);
void onNewFolderToCreate();
void onDropMe(const QMimeData* _data);
void onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUrl, QString pContentHeader, QByteArray pData);
signals:
void navigBarUpdate(UBLibElement* pElem);
void itemsSelected(QList<UBLibElement*> elemList, bool inTrash);

@ -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)

@ -84,7 +84,6 @@ QNetworkReply* UBNetworkAccessManager::createRequest(Operation op, const QNetwor
QNetworkReply *UBNetworkAccessManager::get(const QNetworkRequest &request)
{
qDebug() << "request url: " << request.url();
QTime loadStartTime;
loadStartTime.start();
QNetworkReply *networkReply = QNetworkAccessManager::get(request);

@ -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)

Loading…
Cancel
Save