From 26f6de78512f2c98353a1d80a21717233d403598 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Thu, 5 Nov 2015 15:06:03 +0100 Subject: [PATCH] Minor compatibility updates (strings etc; missing includes) --- src/adaptors/UBSvgSubsetAdaptor.cpp | 7 ++++--- src/adaptors/publishing/UBDocumentPublisher.cpp | 2 +- src/api/UBW3CWidgetAPI.cpp | 2 +- src/api/UBWidgetUniboardAPI.cpp | 8 ++++---- src/board/UBBoardView.h | 3 +++ src/core/UBPersistenceManager.cpp | 4 ++-- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index b58eac6f..728d8c35 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include "domain/UBGraphicsSvgItem.h" #include "domain/UBGraphicsPixmapItem.h" @@ -329,7 +330,7 @@ QUuid UBSvgSubsetAdaptor::sceneUuid(UBDocumentProxy* proxy, const int pageIndex) UBGraphicsScene* UBSvgSubsetAdaptor::loadScene(UBDocumentProxy* proxy, const QByteArray& pArray) { - UBSvgSubsetReader reader(proxy, UBTextTools::cleanHtmlCData(QString(pArray)).toAscii()); + UBSvgSubsetReader reader(proxy, UBTextTools::cleanHtmlCData(QString(pArray)).toLatin1()); return reader.loadScene(); } @@ -1335,7 +1336,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro QUuid uuid = UBGraphicsScene::getPersonalUuid(groupItem); if (!uuid.isNull()) { QDomElement curGroupElement = groupDomDocument->createElement(tGroup); - curGroupElement.setAttribute(aId, uuid); + curGroupElement.setAttribute(aId, uuid.toString()); UBGraphicsGroupContainerItem* group = dynamic_cast(groupItem); if(group && group->Delegate()){ if(group->Delegate()->isLocked()) @@ -1351,7 +1352,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro persistGroupToDom(item, curParent, groupDomDocument); else { QDomElement curSubElement = groupDomDocument->createElement(tElement); - curSubElement.setAttribute(aId, tmpUuid); + curSubElement.setAttribute(aId, tmpUuid.toString()); curGroupElement.appendChild(curSubElement); } } diff --git a/src/adaptors/publishing/UBDocumentPublisher.cpp b/src/adaptors/publishing/UBDocumentPublisher.cpp index bc8b6381..b285d493 100644 --- a/src/adaptors/publishing/UBDocumentPublisher.cpp +++ b/src/adaptors/publishing/UBDocumentPublisher.cpp @@ -24,7 +24,7 @@ - +#include #include "UBDocumentPublisher.h" diff --git a/src/api/UBW3CWidgetAPI.cpp b/src/api/UBW3CWidgetAPI.cpp index 16ef1347..a4a4d4d4 100644 --- a/src/api/UBW3CWidgetAPI.cpp +++ b/src/api/UBW3CWidgetAPI.cpp @@ -59,7 +59,7 @@ UBW3CWidgetAPI::~UBW3CWidgetAPI() QString UBW3CWidgetAPI::uuid() { if (mGraphicsW3CWidget) - return mGraphicsW3CWidget->uuid(); + return mGraphicsW3CWidget->uuid().toString(); else return ""; } diff --git a/src/api/UBWidgetUniboardAPI.cpp b/src/api/UBWidgetUniboardAPI.cpp index 10b92c64..c4d381e9 100644 --- a/src/api/UBWidgetUniboardAPI.cpp +++ b/src/api/UBWidgetUniboardAPI.cpp @@ -514,7 +514,7 @@ void UBWidgetUniboardAPI::ProcessDropEvent(QGraphicsSceneDragDropEvent *event) QString str = "test string"; QMimeData mimeData; - mimeData.setData(tMimeText, str.toAscii()); + mimeData.setData(tMimeText, str.toLatin1()); sDownloadFileDesc desc; desc.dest = sDownloadFileDesc::graphicsWidget; @@ -556,7 +556,7 @@ void UBWidgetUniboardAPI::ProcessDropEvent(QGraphicsSceneDragDropEvent *event) } qDebug() << destFileName; QString mimeText = createMimeText(downloaded, contentType, destFileName); - dropMimeData->setData(tMimeText, mimeText.toAscii()); + dropMimeData->setData(tMimeText, mimeText.toLatin1()); event->setMimeData(dropMimeData); } @@ -588,7 +588,7 @@ void UBWidgetUniboardAPI::onDownloadFinished(bool pSuccess, sDownloadFileDesc de } } - QString destFileName = objDir + QUuid::createUuid() + "." + extention; + QString destFileName = objDir + QUuid::createUuid().toString() + "." + extention; QFile destFile(destFileName); if (!destFile.open(QIODevice::WriteOnly)) { @@ -606,7 +606,7 @@ void UBWidgetUniboardAPI::onDownloadFinished(bool pSuccess, sDownloadFileDesc de QMimeData dropMimeData; QString mimeText = createMimeText(true, contentType, destFileName); - dropMimeData.setData(tMimeText, mimeText.toAscii()); + dropMimeData.setData(tMimeText, mimeText.toLatin1()); destFile.close(); diff --git a/src/board/UBBoardView.h b/src/board/UBBoardView.h index 14b8dec9..6326acb4 100644 --- a/src/board/UBBoardView.h +++ b/src/board/UBBoardView.h @@ -30,6 +30,9 @@ #define CONTROLVIEW_OBJ_NAME "ControlView" #include +#include +#include + #include "core/UB.h" #include "domain/UBGraphicsDelegateFrame.h" diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 64e57691..60c271ef 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -596,7 +596,7 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in UBGraphicsPixmapItem* pixmapItem = qgraphicsitem_cast(item); if(pixmapItem){ - QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + pixmapItem->uuid() + ".png"; + QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + pixmapItem->uuid().toString() + ".png"; QString destination = source; QUuid newUuid = QUuid::createUuid(); QString fileName = QFileInfo(source).completeBaseName(); @@ -608,7 +608,7 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in UBGraphicsSvgItem* svgItem = qgraphicsitem_cast(item); if(svgItem){ - QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + svgItem->uuid() + ".svg"; + QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + svgItem->uuid().toString() + ".svg"; QString destination = source; QUuid newUuid = QUuid::createUuid(); QString fileName = QFileInfo(source).completeBaseName();