Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
b8f006d1
Commit
b8f006d1
authored
Aug 18, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import procedure, improving of code, insertion of objects into existing document errors fix
parent
5b6ed8e5
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
392 additions
and
288 deletions
+392
-288
UBCFFSubsetAdaptor.cpp
src/adaptors/UBCFFSubsetAdaptor.cpp
+25
-4
UBImportAdaptor.cpp
src/adaptors/UBImportAdaptor.cpp
+18
-2
UBImportAdaptor.h
src/adaptors/UBImportAdaptor.h
+29
-3
UBImportCFF.cpp
src/adaptors/UBImportCFF.cpp
+3
-3
UBImportCFF.h
src/adaptors/UBImportCFF.h
+2
-5
UBImportDocument.cpp
src/adaptors/UBImportDocument.cpp
+3
-3
UBImportDocument.h
src/adaptors/UBImportDocument.h
+2
-2
UBImportImage.cpp
src/adaptors/UBImportImage.cpp
+36
-3
UBImportImage.h
src/adaptors/UBImportImage.h
+4
-2
UBImportPDF.cpp
src/adaptors/UBImportPDF.cpp
+43
-1
UBImportPDF.h
src/adaptors/UBImportPDF.h
+4
-2
UBBoardController.cpp
src/board/UBBoardController.cpp
+62
-11
UBDocumentManager.cpp
src/core/UBDocumentManager.cpp
+107
-100
UBDocumentManager.h
src/core/UBDocumentManager.h
+1
-3
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+47
-135
UBPersistenceManager.h
src/core/UBPersistenceManager.h
+2
-6
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+4
-3
No files found.
src/adaptors/UBCFFSubsetAdaptor.cpp
View file @
b8f006d1
...
...
@@ -869,8 +869,18 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgAudio(const QDomElement &ele
QUuid
uuid
=
QUuid
::
createUuid
();
concreteUrl
=
QUrl
::
fromLocalFile
(
UBPersistenceManager
::
persistenceManager
()
->
addAudioFileToDocument
(
mCurrentScene
->
document
(),
concreteUrl
.
toLocalFile
(),
uuid
));
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
mCurrentScene
->
document
(),
concreteUrl
.
toLocalFile
(),
UBPersistenceManager
::
audioDirectory
,
uuid
,
destFile
);
if
(
!
b
)
{
return
false
;
}
concreteUrl
=
QUrl
::
fromLocalFile
(
destFile
);
UBGraphicsMediaItem
*
audioItem
=
mCurrentScene
->
addAudio
(
concreteUrl
,
false
);
QTransform
transform
;
...
...
@@ -912,8 +922,19 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgVideo(const QDomElement &ele
QUuid
uuid
=
QUuid
::
createUuid
();
concreteUrl
=
QUrl
::
fromLocalFile
(
UBPersistenceManager
::
persistenceManager
()
->
addVideoFileToDocument
(
mCurrentScene
->
document
(),
concreteUrl
.
toLocalFile
(),
uuid
));
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
mCurrentScene
->
document
(),
concreteUrl
.
toLocalFile
(),
UBPersistenceManager
::
videoDirectory
,
uuid
,
destFile
);
if
(
!
b
)
{
return
false
;
}
concreteUrl
=
QUrl
::
fromLocalFile
(
destFile
);
UBGraphicsMediaItem
*
videoItem
=
mCurrentScene
->
addVideo
(
concreteUrl
,
false
);
QTransform
transform
;
...
...
src/adaptors/UBImportAdaptor.cpp
View file @
b8f006d1
...
...
@@ -22,8 +22,9 @@
#include "core/memcheck.h"
UBImportAdaptor
::
UBImportAdaptor
(
QObject
*
parent
)
:
QObject
(
parent
)
UBImportAdaptor
::
UBImportAdaptor
(
bool
_documentBased
,
QObject
*
parent
)
:
QObject
(
parent
),
documentBased
(
_documentBased
)
{
// NOOP
}
...
...
@@ -33,6 +34,20 @@ UBImportAdaptor::~UBImportAdaptor()
// NOOP
}
UBPageBasedImportAdaptor
::
UBPageBasedImportAdaptor
(
QObject
*
parent
)
:
UBImportAdaptor
(
false
,
parent
)
{
// NOOP
}
UBDocumentBasedImportAdaptor
::
UBDocumentBasedImportAdaptor
(
QObject
*
parent
)
:
UBImportAdaptor
(
true
,
parent
)
{
// NOOP
}
/*
UBDocumentProxy* UBImportAdaptor::importFile(const QFile& pFile, const QString& pGroup)
{
QString documentName = QFileInfo(pFile.fileName()).completeBaseName();
...
...
@@ -53,3 +68,4 @@ UBDocumentProxy* UBImportAdaptor::importFile(const QFile& pFile, const QString&
return newDocument;
}
*/
\ No newline at end of file
src/adaptors/UBImportAdaptor.h
View file @
b8f006d1
...
...
@@ -18,6 +18,8 @@
#include <QtGui>
class
UBGraphicsItem
;
class
UBGraphicsScene
;
class
UBDocumentProxy
;
class
UBImportAdaptor
:
public
QObject
...
...
@@ -25,15 +27,39 @@ class UBImportAdaptor : public QObject
Q_OBJECT
;
protected
:
UBImportAdaptor
(
QObject
*
parent
=
0
);
UBImportAdaptor
(
bool
_documentBased
,
QObject
*
parent
=
0
);
virtual
~
UBImportAdaptor
();
public
:
virtual
QStringList
supportedExtentions
()
=
0
;
virtual
QString
importFileFilter
()
=
0
;
virtual
UBDocumentProxy
*
importFile
(
const
QFile
&
pFile
,
const
QString
&
pGroup
);
bool
isDocumentBased
(){
return
documentBased
;}
private
:
bool
documentBased
;
};
class
UBPageBasedImportAdaptor
:
public
UBImportAdaptor
{
protected
:
UBPageBasedImportAdaptor
(
QObject
*
parent
=
0
);
public
:
virtual
QList
<
UBGraphicsItem
*>
import
(
const
QUuid
&
uuid
,
const
QString
&
filePath
)
=
0
;
virtual
void
placeImportedItemToScene
(
UBGraphicsScene
*
scene
,
UBGraphicsItem
*
item
)
=
0
;
virtual
const
QString
&
folderToCopy
()
=
0
;
};
class
UBDocumentBasedImportAdaptor
:
public
UBImportAdaptor
{
protected
:
UBDocumentBasedImportAdaptor
(
QObject
*
parent
=
0
);
public
:
virtual
UBDocumentProxy
*
importFile
(
const
QFile
&
pFile
,
const
QString
&
pGroup
)
=
0
;
virtual
bool
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
)
=
0
;
};
#endif
/* UBIMPORTADAPTOR_H_ */
src/adaptors/UBImportCFF.cpp
View file @
b8f006d1
...
...
@@ -14,6 +14,7 @@
*/
#include <QDir>
#include <QList>
#include "core/UBApplication.h"
#include "core/UBPersistenceManager.h"
...
...
@@ -38,7 +39,7 @@ THIRD_PARTY_WARNINGS_ENABLE
#include "core/memcheck.h"
UBImportCFF
::
UBImportCFF
(
QObject
*
parent
)
:
UBImportAdaptor
(
parent
)
:
UB
DocumentBased
ImportAdaptor
(
parent
)
{
// NOOP
}
...
...
@@ -77,7 +78,6 @@ QString UBImportCFF::importFileFilter()
return
filter
;
}
bool
UBImportCFF
::
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
)
{
QFileInfo
fi
(
pFile
);
...
...
@@ -220,6 +220,7 @@ QString UBImportCFF::expandFileToDir(const QFile& pZipFile, const QString& pDir)
return
documentRootFolder
;
}
UBDocumentProxy
*
UBImportCFF
::
importFile
(
const
QFile
&
pFile
,
const
QString
&
pGroup
)
{
Q_UNUSED
(
pGroup
);
// group is defined in the imported file
...
...
@@ -277,4 +278,3 @@ UBDocumentProxy* UBImportCFF::importFile(const QFile& pFile, const QString& pGro
return
newDocument
;
}
}
src/adaptors/UBImportCFF.h
View file @
b8f006d1
...
...
@@ -21,7 +21,7 @@
class
UBDocumentProxy
;
class
UBImportCFF
:
public
UBImportAdaptor
class
UBImportCFF
:
public
UB
DocumentBased
ImportAdaptor
{
Q_OBJECT
;
...
...
@@ -33,13 +33,10 @@ class UBImportCFF : public UBImportAdaptor
virtual
QString
importFileFilter
();
virtual
bool
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
);
//base class method override
virtual
UBDocumentProxy
*
importFile
(
const
QFile
&
pFile
,
const
QString
&
pGroup
);
private
:
virtual
QString
expandFileToDir
(
const
QFile
&
pZipFile
,
const
QString
&
pDir
);
QString
expandFileToDir
(
const
QFile
&
pZipFile
,
const
QString
&
pDir
);
};
#endif // UBIMPORTCFF_H
src/adaptors/UBImportDocument.cpp
View file @
b8f006d1
...
...
@@ -33,7 +33,7 @@ THIRD_PARTY_WARNINGS_ENABLE
#include "core/memcheck.h"
UBImportDocument
::
UBImportDocument
(
QObject
*
parent
)
:
UBImportAdaptor
(
parent
)
:
UB
DocumentBased
ImportAdaptor
(
parent
)
{
// NOOP
}
...
...
@@ -173,7 +173,6 @@ QString UBImportDocument::expandFileToDir(const QFile& pZipFile, const QString&
return
documentRootFolder
;
}
UBDocumentProxy
*
UBImportDocument
::
importFile
(
const
QFile
&
pFile
,
const
QString
&
pGroup
)
{
Q_UNUSED
(
pGroup
);
// group is defined in the imported file
...
...
@@ -197,7 +196,6 @@ UBDocumentProxy* UBImportDocument::importFile(const QFile& pFile, const QString&
}
}
bool
UBImportDocument
::
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
)
{
QFileInfo
fi
(
pFile
);
...
...
@@ -215,3 +213,5 @@ bool UBImportDocument::addFileToDocument(UBDocumentProxy* pDocument, const QFile
return
true
;
}
src/adaptors/UBImportDocument.h
View file @
b8f006d1
...
...
@@ -21,7 +21,7 @@
class
UBDocumentProxy
;
class
UBImportDocument
:
public
UBImportAdaptor
class
UBImportDocument
:
public
UB
DocumentBased
ImportAdaptor
{
Q_OBJECT
;
...
...
@@ -37,7 +37,7 @@ class UBImportDocument : public UBImportAdaptor
virtual
bool
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
);
private
:
virtual
QString
expandFileToDir
(
const
QFile
&
pZipFile
,
const
QString
&
pDir
);
QString
expandFileToDir
(
const
QFile
&
pZipFile
,
const
QString
&
pDir
);
};
#endif
/* UBIMPORTDOCUMENT_H_ */
src/adaptors/UBImportImage.cpp
View file @
b8f006d1
...
...
@@ -21,14 +21,14 @@
#include "core/UBPersistenceManager.h"
#include "core/UBDocumentManager.h"
#include "domain/UBGraphicsP
DF
Item.h"
#include "domain/UBGraphicsP
ixmap
Item.h"
#include "pdf/PDFRenderer.h"
#include "core/memcheck.h"
UBImportImage
::
UBImportImage
(
QObject
*
parent
)
:
UBImportAdaptor
(
parent
)
:
UB
PageBased
ImportAdaptor
(
parent
)
{
// NOOP
}
...
...
@@ -74,7 +74,7 @@ QString UBImportImage::importFileFilter()
return
filter
;
}
/*
bool UBImportImage::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile)
{
int res = UBDocumentManager::documentManager()->addImageAsPageToDocument(QStringList(QFileInfo(pFile).absoluteFilePath()), pDocument);
...
...
@@ -89,3 +89,36 @@ bool UBImportImage::addFileToDocument(UBDocumentProxy* pDocument, const QFile& p
return true;
}
}
*/
QList
<
UBGraphicsItem
*>
UBImportImage
::
import
(
const
QUuid
&
uuid
,
const
QString
&
filePath
)
{
QList
<
UBGraphicsItem
*>
result
;
QPixmap
pix
(
filePath
);
if
(
pix
.
isNull
())
return
result
;
UBGraphicsPixmapItem
*
pixmapItem
=
new
UBGraphicsPixmapItem
();
pixmapItem
->
setPixmap
(
pix
);
result
<<
pixmapItem
;
return
result
;
}
void
UBImportImage
::
placeImportedItemToScene
(
UBGraphicsScene
*
scene
,
UBGraphicsItem
*
item
)
{
UBGraphicsPixmapItem
*
pixmapItem
=
(
UBGraphicsPixmapItem
*
)
item
;
UBGraphicsPixmapItem
*
sceneItem
=
scene
->
addPixmap
(
pixmapItem
->
pixmap
(),
NULL
,
QPointF
(
0
,
0
));
scene
->
setAsBackgroundObject
(
sceneItem
,
true
);
// Only stored pixmap, should be deleted now
delete
pixmapItem
;
}
const
QString
&
UBImportImage
::
folderToCopy
()
{
static
QString
f
(
""
);
return
f
;
}
src/adaptors/UBImportImage.h
View file @
b8f006d1
...
...
@@ -21,7 +21,7 @@
class
UBDocumentProxy
;
class
UBImportImage
:
public
UBImportAdaptor
class
UBImportImage
:
public
UB
PageBased
ImportAdaptor
{
Q_OBJECT
;
...
...
@@ -32,7 +32,9 @@ class UBImportImage : public UBImportAdaptor
virtual
QStringList
supportedExtentions
();
virtual
QString
importFileFilter
();
virtual
bool
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
);
virtual
QList
<
UBGraphicsItem
*>
import
(
const
QUuid
&
uuid
,
const
QString
&
filePath
);
virtual
void
placeImportedItemToScene
(
UBGraphicsScene
*
scene
,
UBGraphicsItem
*
item
);
virtual
const
QString
&
folderToCopy
();
};
#endif
/* UBIMPORTIMAGE_H_ */
src/adaptors/UBImportPDF.cpp
View file @
b8f006d1
...
...
@@ -27,7 +27,7 @@
#include "core/memcheck.h"
UBImportPDF
::
UBImportPDF
(
QObject
*
parent
)
:
UBImportAdaptor
(
parent
)
:
UB
PageBased
ImportAdaptor
(
parent
)
{
QDesktopWidget
*
desktop
=
UBApplication
::
desktop
();
this
->
dpi
=
(
desktop
->
physicalDpiX
()
+
desktop
->
physicalDpiY
())
/
2
;
...
...
@@ -52,6 +52,47 @@ QString UBImportPDF::importFileFilter()
}
QList
<
UBGraphicsItem
*>
UBImportPDF
::
import
(
const
QUuid
&
uuid
,
const
QString
&
filePath
)
{
QList
<
UBGraphicsItem
*>
result
;
PDFRenderer
*
pdfRenderer
=
PDFRenderer
::
rendererForUuid
(
uuid
,
filePath
,
true
);
// renderer is automatically deleted when not used anymore
if
(
!
pdfRenderer
->
isValid
())
{
UBApplication
::
showMessage
(
tr
(
"PDF import failed."
));
return
result
;
}
pdfRenderer
->
setDPI
(
this
->
dpi
);
int
pdfPageCount
=
pdfRenderer
->
pageCount
();
for
(
int
pdfPageNumber
=
1
;
pdfPageNumber
<=
pdfPageCount
;
pdfPageNumber
++
)
{
UBApplication
::
showMessage
(
tr
(
"Importing page %1 of %2"
).
arg
(
pdfPageNumber
).
arg
(
pdfPageCount
),
true
);
result
<<
new
UBGraphicsPDFItem
(
pdfRenderer
,
pdfPageNumber
);
// deleted by the scene
}
return
result
;
}
void
UBImportPDF
::
placeImportedItemToScene
(
UBGraphicsScene
*
scene
,
UBGraphicsItem
*
item
)
{
UBGraphicsPDFItem
*
pdfItem
=
(
UBGraphicsPDFItem
*
)
item
;
pdfItem
->
setPos
(
-
pdfItem
->
boundingRect
().
width
()
/
2
,
-
pdfItem
->
boundingRect
().
height
()
/
2
);
scene
->
setAsBackgroundObject
(
pdfItem
,
false
,
false
);
scene
->
setNominalSize
(
pdfItem
->
boundingRect
().
width
(),
pdfItem
->
boundingRect
().
height
());
}
const
QString
&
UBImportPDF
::
folderToCopy
()
{
return
UBPersistenceManager
::
objectDirectory
;
}
/*
bool UBImportPDF::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile)
{
QString documentName = QFileInfo(pFile.fileName()).completeBaseName();
...
...
@@ -112,3 +153,4 @@ bool UBImportPDF::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFi
return true;
}
*/
\ No newline at end of file
src/adaptors/UBImportPDF.h
View file @
b8f006d1
...
...
@@ -21,7 +21,7 @@
class
UBDocumentProxy
;
class
UBImportPDF
:
public
UBImportAdaptor
class
UBImportPDF
:
public
UB
PageBased
ImportAdaptor
{
Q_OBJECT
;
...
...
@@ -32,7 +32,9 @@ class UBImportPDF : public UBImportAdaptor
virtual
QStringList
supportedExtentions
();
virtual
QString
importFileFilter
();
virtual
bool
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
);
virtual
QList
<
UBGraphicsItem
*>
import
(
const
QUuid
&
uuid
,
const
QString
&
filePath
);
virtual
void
placeImportedItemToScene
(
UBGraphicsScene
*
scene
,
UBGraphicsItem
*
item
);
virtual
const
QString
&
folderToCopy
();
private
:
int
dpi
;
...
...
src/board/UBBoardController.cpp
View file @
b8f006d1
...
...
@@ -1074,8 +1074,20 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
{
QUuid
uuid
=
QUuid
::
createUuid
();
QUrl
url
=
QUrl
::
fromLocalFile
(
UBPersistenceManager
::
persistenceManager
()
->
addVideoFileToDocument
(
selectedDocument
(),
sourceUrl
,
pData
,
uuid
));
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
""
,
UBPersistenceManager
::
videoDirectory
,
uuid
,
destFile
,
&
pData
);
if
(
!
b
)
{
showMessage
(
tr
(
"Add file operation failed: file copying error"
));
return
NULL
;
}
QUrl
url
=
QUrl
::
fromLocalFile
(
destFile
);
mediaVideoItem
=
mActiveScene
->
addMedia
(
url
,
false
,
pPos
);
...
...
@@ -1105,8 +1117,20 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
{
QUuid
uuid
=
QUuid
::
createUuid
();
QUrl
url
=
QUrl
::
fromLocalFile
(
UBPersistenceManager
::
persistenceManager
()
->
addAudioFileToDocument
(
selectedDocument
(),
sourceUrl
,
pData
,
uuid
));
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
""
,
UBPersistenceManager
::
audioDirectory
,
uuid
,
destFile
,
&
pData
);
if
(
!
b
)
{
showMessage
(
tr
(
"Add file operation failed: file copying error"
));
return
NULL
;
}
QUrl
url
=
QUrl
::
fromLocalFile
(
destFile
);
audioMediaItem
=
mActiveScene
->
addMedia
(
url
,
false
,
pPos
);
...
...
@@ -1186,15 +1210,18 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
qDebug
()
<<
"sourceurl : "
+
sourceUrl
.
toString
();
int
result
=
0
;
if
(
!
sourceUrl
.
isEmpty
()){
QFile
sourceFile
(
sourceUrl
.
toLocalFile
());
result
=
UBDocumentManager
::
documentManager
()
->
addFileToDocument
(
selectedDocument
(),
sourceFile
);
QStringList
fileNames
;
fileNames
<<
sourceUrl
.
toLocalFile
();
result
=
UBDocumentManager
::
documentManager
()
->
addFilesToDocument
(
selectedDocument
(),
fileNames
);
}
else
if
(
pData
.
size
()){
QTemporaryFile
pdfFile
(
"XXXXXX.pdf"
);
if
(
pdfFile
.
open
())
{
pdfFile
.
write
(
pData
);
result
=
UBDocumentManager
::
documentManager
()
->
addFileToDocument
(
selectedDocument
(),
pdfFile
);
QStringList
fileNames
;
fileNames
<<
pdfFile
.
fileName
();
result
=
UBDocumentManager
::
documentManager
()
->
addFilesToDocument
(
selectedDocument
(),
fileNames
);
pdfFile
.
close
();
}
}
...
...
@@ -1904,7 +1931,18 @@ UBGraphicsMediaItem* UBBoardController::addVideo(const QUrl& pSourceUrl, bool st
QUuid
uuid
=
QUuid
::
createUuid
();
QUrl
concreteUrl
=
pSourceUrl
;
concreteUrl
=
QUrl
::
fromLocalFile
(
UBPersistenceManager
::
persistenceManager
()
->
addVideoFileToDocument
(
selectedDocument
(),
pSourceUrl
.
toLocalFile
(),
uuid
));
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
pSourceUrl
.
toLocalFile
(),
UBPersistenceManager
::
videoDirectory
,
uuid
,
destFile
);
if
(
!
b
)
{
showMessage
(
tr
(
"Add file operation failed: file copying error"
));
return
NULL
;
}
concreteUrl
=
QUrl
::
fromLocalFile
(
destFile
);
UBGraphicsMediaItem
*
vi
=
mActiveScene
->
addMedia
(
concreteUrl
,
startPlay
,
pos
);
selectedDocument
()
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
()));
...
...
@@ -1923,7 +1961,18 @@ UBGraphicsMediaItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool st
QUuid
uuid
=
QUuid
::
createUuid
();
QUrl
concreteUrl
=
pSourceUrl
;
concreteUrl
=
QUrl
::
fromLocalFile
(
UBPersistenceManager
::
persistenceManager
()
->
addAudioFileToDocument
(
selectedDocument
(),
pSourceUrl
.
toLocalFile
(),
uuid
));
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
pSourceUrl
.
toLocalFile
(),
UBPersistenceManager
::
audioDirectory
,
uuid
,
destFile
);
if
(
!
b
)
{
showMessage
(
tr
(
"Add file operation failed: file copying error"
));
return
NULL
;
}
concreteUrl
=
QUrl
::
fromLocalFile
(
destFile
);
UBGraphicsMediaItem
*
ai
=
mActiveScene
->
addMedia
(
concreteUrl
,
startPlay
,
pos
);
selectedDocument
()
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
()));
...
...
@@ -1942,9 +1991,11 @@ UBGraphicsWidgetItem *UBBoardController::addW3cWidget(const QUrl &pUrl, const QP
UBGraphicsWidgetItem
*
w3cWidgetItem
=
0
;
QUuid
uuid
=
QUuid
::
createUuid
();
QUrl
newUrl
=
pUrl
;
newUrl
=
QUrl
::
fromLocalFile
(
UBPersistenceManager
::
persistenceManager
()
->
addGraphicsWidgteToDocument
(
selectedDocument
(),
pUrl
.
toLocalFile
(),
uuid
));
QString
destPath
;
if
(
!
UBPersistenceManager
::
persistenceManager
()
->
addGraphicsWidgteToDocument
(
selectedDocument
(),
pUrl
.
toLocalFile
(),
uuid
,
destPath
))
return
NULL
;
QUrl
newUrl
=
QUrl
::
fromLocalFile
(
destPath
);
w3cWidgetItem
=
mActiveScene
->
addW3CWidget
(
newUrl
,
pos
);
...
...
src/core/UBDocumentManager.cpp
View file @
b8f006d1
...
...
@@ -128,36 +128,124 @@ UBDocumentProxy* UBDocumentManager::importFile(const QFile& pFile, const QString
{
QFileInfo
fileInfo
(
pFile
);
UBDocumentProxy
*
document
=
0
;
foreach
(
UBImportAdaptor
*
importAdaptor
,
mImportAdaptors
)
foreach
(
UBImportAdaptor
*
adaptor
,
mImportAdaptors
)
{
if
(
importA
daptor
->
supportedExtentions
().
lastIndexOf
(
fileInfo
.
suffix
().
toLower
())
!=
-
1
)
if
(
a
daptor
->
supportedExtentions
().
lastIndexOf
(
fileInfo
.
suffix
().
toLower
())
!=
-
1
)
{
UBDocumentProxy
*
document
;
UBApplication
::
setDisabled
(
true
);
if
(
adaptor
->
isDocumentBased
())
{
UBDocumentBasedImportAdaptor
*
importAdaptor
=
(
UBDocumentBasedImportAdaptor
*
)
adaptor
;
document
=
importAdaptor
->
importFile
(
pFile
,
pGroup
);
}
else
{
UBPageBasedImportAdaptor
*
importAdaptor
=
(
UBPageBasedImportAdaptor
*
)
adaptor
;
// Document import procedure.....
QString
documentName
=
QFileInfo
(
pFile
.
fileName
()).
completeBaseName
();
document
=
UBPersistenceManager
::
persistenceManager
()
->
createDocument
(
pGroup
,
documentName
);
QUuid
uuid
=
QUuid
::
createUuid
();
QString
filepath
=
pFile
.
fileName
();
if
(
importAdaptor
->
folderToCopy
()
!=
""
)
{
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
document
,
pFile
.
fileName
(),
importAdaptor
->
folderToCopy
()
,
uuid
,
filepath
);
if
(
!
b
)
{
UBPersistenceManager
::
persistenceManager
()
->
deleteDocument
(
document
);
UBApplication
::
setDisabled
(
false
);
return
NULL
;
}
}
QList
<
UBGraphicsItem
*>
pages
=
importAdaptor
->
import
(
uuid
,
filepath
);
int
nPage
=
0
;
foreach
(
UBGraphicsItem
*
page
,
pages
)
{
UBApplication
::
showMessage
(
tr
(
"Inserting page %1 of %2"
).
arg
(
++
nPage
).
arg
(
pages
.
size
()),
true
);
int
pageIndex
=
document
->
pageCount
();
UBGraphicsScene
*
scene
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentSceneAt
(
document
,
pageIndex
);
importAdaptor
->
placeImportedItemToScene
(
scene
,
page
);
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
document
,
scene
,
pageIndex
);
}
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentMetadata
(
document
);
UBApplication
::
showMessage
(
tr
(
"Import successful."
));
}
UBApplication
::
setDisabled
(
false
);
return
document
;
}
}
return
NULL
;
}
bool
UBDocumentManager
::
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
)
int
UBDocumentManager
::
addFilesToDocument
(
UBDocumentProxy
*
document
,
QStringList
fileNames
)
{
QFileInfo
fileInfo
(
pFile
)
;
foreach
(
UBImportAdaptor
*
importAdaptor
,
mImportAdaptor
s
)
int
nImportedDocuments
=
0
;
foreach
(
const
QString
&
fileName
,
fileName
s
)
{
if
(
importAdaptor
->
supportedExtentions
().
lastIndexOf
(
fileInfo
.
suffix
().
toLower
())
!=
-
1
)
UBApplication
::
showMessage
(
tr
(
"Importing file"
).
arg
(
fileName
));
QFile
file
(
fileName
);
QFileInfo
fileInfo
(
file
);
foreach
(
UBImportAdaptor
*
adaptor
,
mImportAdaptors
)
{
if
(
adaptor
->
supportedExtentions
().
lastIndexOf
(
fileInfo
.
suffix
().
toLower
())
!=
-
1
)
{
UBApplication
::
setDisabled
(
true
);
bool
result
=
importAdaptor
->
addFileToDocument
(
pDocument
,
pFile
);
if
(
adaptor
->
isDocumentBased
())
{
UBDocumentBasedImportAdaptor
*
importAdaptor
=
(
UBDocumentBasedImportAdaptor
*
)
adaptor
;
if
(
importAdaptor
->
addFileToDocument
(
document
,
file
))
nImportedDocuments
++
;
}
else
{
UBPageBasedImportAdaptor
*
importAdaptor
=
(
UBPageBasedImportAdaptor
*
)
adaptor
;
QUuid
uuid
=
QUuid
::
createUuid
();
QString
filepath
=
file
.
fileName
();
if
(
importAdaptor
->
folderToCopy
()
!=
""
)
{
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
document
,
file
.
fileName
(),
importAdaptor
->
folderToCopy
()
,
uuid
,
filepath
);
if
(
!
b
)
{
continue
;
}
}
QList
<
UBGraphicsItem
*>
pages
=
importAdaptor
->
import
(
uuid
,
filepath
);
int
nPage
=
0
;
foreach
(
UBGraphicsItem
*
page
,
pages
)
{
UBApplication
::
showMessage
(
tr
(
"Inserting page %1 of %2"
).
arg
(
++
nPage
).
arg
(
pages
.
size
()),
true
);
int
pageIndex
=
document
->
pageCount
();
UBGraphicsScene
*
scene
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentSceneAt
(
document
,
pageIndex
);
importAdaptor
->
placeImportedItemToScene
(
scene
,
page
);
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
document
,
scene
,
pageIndex
);
}
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentMetadata
(
document
);
UBApplication
::
showMessage
(
tr
(
"Import of file %1 successful."
).
arg
(
file
.
fileName
()));
nImportedDocuments
++
;
}
UBApplication
::
setDisabled
(
false
);
return
result
;
}
}
return
false
;
}
return
nImportedDocuments
;
}
...
...
@@ -167,14 +255,14 @@ int UBDocumentManager::addImageDirToDocument(const QDir& pDir, UBDocumentProxy*
filenames
=
UBStringUtils
::
sortByLastDigit
(
filenames
);
QStringList
f
ullPathFilen
ames
;
QStringList
f
ileN
ames
;
foreach
(
QString
f
,
filenames
)
{
f
ullPathFilen
ames
<<
pDir
.
absolutePath
()
+
"/"
+
f
;
f
ileN
ames
<<
pDir
.
absolutePath
()
+
"/"
+
f
;
}
return
add
ImageAsPageToDocument
(
fullPathFilenames
,
pDocument
);
return
add
FilesToDocument
(
pDocument
,
fileNames
);
}
...
...
@@ -209,87 +297,6 @@ QList<UBExportAdaptor*> UBDocumentManager::supportedExportAdaptors()
return
mExportAdaptors
;
}
int
UBDocumentManager
::
addImageAsPageToDocument
(
const
QStringList
&
filenames
,
UBDocumentProxy
*
pDocument
)
{
int
result
=
0
;
if
(
filenames
.
size
()
>
0
)
{
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
QApplication
::
processEvents
();
int
pageIndex
=
pDocument
->
pageCount
();
if
(
pageIndex
==
1
&&
UBPersistenceManager
::
persistenceManager
()
->
loadDocumentScene
(
pDocument
,
0
)
->
isEmpty
())
{
pageIndex
=
0
;
}
int
expectedPageCount
=
filenames
.
size
();
for
(
int
i
=
0
;
i
<
filenames
.
size
();
i
++
)
{
UBApplication
::
showMessage
(
tr
(
"Importing page %1 of %2"
).
arg
(
i
+
1
).
arg
(
expectedPageCount
));
UBGraphicsScene
*
scene
=
0
;
QString
fullPath
=
filenames
.
at
(
i
);
QGraphicsItem
*
gi
=
0
;
if
(
pageIndex
==
0
)
{
scene
=
UBPersistenceManager
::
persistenceManager
()
->
loadDocumentScene
(
pDocument
,
pageIndex
);
}
else
{
scene
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentSceneAt
(
pDocument
,
pageIndex
);
}
scene
->
setBackground
(
false
,
false
);
if
(
fullPath
.
endsWith
(
".svg"
)
||
fullPath
.
endsWith
(
".svgz"
))
{
gi
=
scene
->
addSvg
(
QUrl
::
fromLocalFile
(
fullPath
),
QPointF
(
0
,
0
));
}
else
{
QPixmap
pix
(
fullPath
);
if
(
pix
.
isNull
())
{
UBApplication
::
showMessage
(
tr
(
"Erronous image data, skipping file %1"
).
arg
(
filenames
.
at
(
i
)));
expectedPageCount
--
;
continue
;
}
else
{
gi
=
scene
->
addPixmap
(
pix
,
NULL
,
QPointF
(
0
,
0
));
}
}
if
(
gi
)
{
scene
->
setAsBackgroundObject
(
gi
,
true
);
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
pDocument
,
scene
,
pageIndex
);
pageIndex
++
;
}
}
result
=
expectedPageCount
;
QApplication
::
restoreOverrideCursor
();
}
return
result
;
}
void
UBDocumentManager
::
emitDocumentUpdated
(
UBDocumentProxy
*
pDocument
)
{
...
...
src/core/UBDocumentManager.h
View file @
b8f006d1
...
...
@@ -36,13 +36,11 @@ class UBDocumentManager : public QObject
UBDocumentProxy
*
importFile
(
const
QFile
&
pFile
,
const
QString
&
pGroup
);
bool
addFileToDocument
(
UBDocumentProxy
*
pDocument
,
const
QFile
&
pFile
);
int
addFilesToDocument
(
UBDocumentProxy
*
pDocument
,
QStringList
fileNames
);
UBDocumentProxy
*
importDir
(
const
QDir
&
pDir
,
const
QString
&
pGroup
);
int
addImageDirToDocument
(
const
QDir
&
pDir
,
UBDocumentProxy
*
pDocument
);
int
addImageAsPageToDocument
(
const
QStringList
&
images
,
UBDocumentProxy
*
document
);
QList
<
UBExportAdaptor
*>
supportedExportAdaptors
();
void
emitDocumentUpdated
(
UBDocumentProxy
*
pDocument
);
...
...
src/core/UBPersistenceManager.cpp
View file @
b8f006d1
...
...
@@ -878,170 +878,82 @@ QString UBPersistenceManager::addObjectToTeacherGuideDirectory(UBDocumentProxy*
return
destPath
;
}
QString
UBPersistenceManager
::
addVideoFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
)
bool
UBPersistenceManager
::
addFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
const
QString
&
subdir
,
QUuid
objectUuid
,
QString
&
destinationPath
,
QByteArray
*
data
)
{
QFileInfo
fi
(
path
);
if
(
!
fi
.
exists
()
||
!
pDocumentProxy
||
objectUuid
.
isNull
())
return
""
;
if
(
!
pDocumentProxy
||
objectUuid
.
isNull
())
return
false
;
if
(
data
==
NULL
&&
!
fi
.
exists
())
return
false
;
QString
fileName
=
UBPersistenceManager
::
videoDirectory
+
"/"
+
objectUuid
.
toString
()
+
"."
+
fi
.
suffix
();
QString
fileName
=
subdir
+
"/"
+
objectUuid
.
toString
()
+
"."
+
fi
.
suffix
();
QString
dest
Path
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
fileName
;
destination
Path
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
destPath
))
if
(
!
QFile
::
exists
(
dest
ination
Path
))
{
QDir
dir
;
dir
.
mkdir
(
pDocumentProxy
->
persistencePath
()
+
"/"
+
UBPersistenceManager
::
videoDirectory
);
dir
.
mkdir
(
pDocumentProxy
->
persistencePath
()
+
"/"
+
subdir
);
if
(
!
QFile
::
exists
(
pDocumentProxy
->
persistencePath
()
+
"/"
+
subdir
))
return
false
;
if
(
data
==
NULL
)
{
QFile
source
(
path
);
source
.
copy
(
destPath
);
return
source
.
copy
(
destinationPath
);
}
return
destPath
;
}
QString
UBPersistenceManager
::
addVideoFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QUrl
sourceUrl
,
QByteArray
pPayload
,
QUuid
objectUuid
)
{
if
(
!
pDocumentProxy
||
objectUuid
.
isNull
())
return
""
;
QString
urlPath
=
sourceUrl
.
path
();
int
lastDot
=
urlPath
.
lastIndexOf
(
"."
);
QString
suffix
=
urlPath
.
right
(
urlPath
.
length
()
-
lastDot
-
1
);
QString
fileName
=
UBPersistenceManager
::
videoDirectory
+
"/"
+
objectUuid
.
toString
()
+
"."
+
suffix
;
QString
destPath
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
destPath
))
else
{
QDir
dir
;
dir
.
mkdir
(
pDocumentProxy
->
persistencePath
()
+
"/"
+
UBPersistenceManager
::
videoDirectory
);
QFile
newFile
(
destPath
);
QFile
newFile
(
destinationPath
);
if
(
newFile
.
open
(
QIODevice
::
WriteOnly
))
{
newFile
.
write
(
pPayload
);
qint64
n
=
newFile
.
write
(
*
data
);
newFile
.
flush
();
newFile
.
close
();
return
n
==
data
->
size
();
}
}
return
destPath
;
}
QString
UBPersistenceManager
::
addAudioFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
)
{
QFileInfo
fi
(
path
);
if
(
!
fi
.
exists
()
||
!
pDocumentProxy
||
objectUuid
.
isNull
())
return
""
;
QString
fileName
=
UBPersistenceManager
::
audioDirectory
+
"/"
+
objectUuid
.
toString
()
+
"."
+
fi
.
suffix
();
QString
destPath
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
destPath
))
else
{
QDir
dir
;
dir
.
mkdir
(
pDocumentProxy
->
persistencePath
()
+
"/"
+
UBPersistenceManager
::
audioDirectory
);
QFile
source
(
path
);
source
.
copy
(
destPath
);
return
false
;
}
return
destPath
;
}
QString
UBPersistenceManager
::
addAudioFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QUrl
sourceUrl
,
QByteArray
pPayload
,
QUuid
objectUuid
)
{
if
(
!
pDocumentProxy
||
objectUuid
.
isNull
())
return
""
;
QString
urlPath
=
sourceUrl
.
path
();
int
lastDot
=
urlPath
.
lastIndexOf
(
"."
);
QString
suffix
=
urlPath
.
right
(
urlPath
.
length
()
-
lastDot
-
1
);
QString
fileName
=
UBPersistenceManager
::
audioDirectory
+
"/"
+
objectUuid
.
toString
()
+
"."
+
suffix
;
QString
destPath
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
destPath
))
{
QDir
dir
;
dir
.
mkdir
(
pDocumentProxy
->
persistencePath
()
+
"/"
+
UBPersistenceManager
::
audioDirectory
);
QFile
newFile
(
destPath
);
if
(
newFile
.
open
(
QIODevice
::
WriteOnly
))
{
newFile
.
write
(
pPayload
);
newFile
.
flush
();
newFile
.
close
();
}
}
//return fileName;
return
destPath
;
}
QString
UBPersistenceManager
::
addPdfFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
)
{
QFileInfo
fi
(
path
);
if
(
!
fi
.
exists
()
||
!
pDocumentProxy
||
objectUuid
.
isNull
())
return
""
;
QString
fileName
=
UBPersistenceManager
::
objectDirectory
+
"/"
+
objectUuid
.
toString
()
+
"."
+
fi
.
suffix
();
QString
destPath
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
destPath
))
else
{
QDir
dir
;
dir
.
mkpath
(
pDocumentProxy
->
persistencePath
()
+
"/"
+
UBPersistenceManager
::
objectDirectory
);
QFile
source
(
path
);
source
.
copy
(
destPath
);
return
false
;
}
return
fileName
;
}
QString
UBPersistenceManager
::
addGraphicsWidgteToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
)
bool
UBPersistenceManager
::
addGraphicsWidgteToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
,
QString
&
destinationPath
)
{
QFileInfo
fi
(
path
);
if
(
!
fi
.
exists
()
||
!
pDocumentProxy
||
objectUuid
.
isNull
())
return
""
;
return
false
;
QString
widgetRootDir
=
path
;
QString
extension
=
QFileInfo
(
widgetRootDir
).
suffix
();
QString
widgetTargetDir
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
widgetDirectory
+
"/"
+
objectUuid
.
toString
()
+
"."
+
extension
;
destinationPath
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
widgetDirectory
+
"/"
+
objectUuid
.
toString
()
+
"."
+
extension
;
if
(
!
QFile
::
exists
(
widgetTargetDir
))
{
if
(
!
QFile
::
exists
(
destinationPath
))
{
QDir
dir
;
dir
.
mkpath
(
widgetTargetDir
);
UBFileSystemUtils
::
copyDir
(
widgetRootDir
,
widgetTargetDir
);
if
(
!
dir
.
mkpath
(
destinationPath
))
return
false
;
return
UBFileSystemUtils
::
copyDir
(
widgetRootDir
,
destinationPath
);
}
if
(
!
QFile
::
exists
(
widgetTargetDir
))
widgetTargetDir
=
QString
();
return
widgetTargetDir
;
else
return
false
;
}
...
...
src/core/UBPersistenceManager.h
View file @
b8f006d1
...
...
@@ -100,12 +100,8 @@ class UBPersistenceManager : public QObject
virtual
bool
isEmpty
(
UBDocumentProxy
*
pDocumentProxy
);
virtual
void
purgeEmptyDocuments
();
virtual
QString
addVideoFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
);
virtual
QString
addVideoFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QUrl
sourceUrl
,
QByteArray
pPayload
,
QUuid
objectUuid
);
virtual
QString
addAudioFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
);
virtual
QString
addAudioFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QUrl
sourceUrl
,
QByteArray
pPayload
,
QUuid
objectUuid
);
virtual
QString
addPdfFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
);
virtual
QString
addGraphicsWidgteToDocument
(
UBDocumentProxy
*
mDocumentProxy
,
QString
path
,
QUuid
objectUuid
);
bool
addGraphicsWidgteToDocument
(
UBDocumentProxy
*
mDocumentProxy
,
QString
path
,
QUuid
objectUuid
,
QString
&
destinationPath
);
bool
addFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
const
QString
&
subdir
,
QUuid
objectUuid
,
QString
&
destinationPath
,
QByteArray
*
data
=
NULL
);
bool
mayHaveVideo
(
UBDocumentProxy
*
pDocumentProxy
);
bool
mayHaveAudio
(
UBDocumentProxy
*
pDocumentProxy
);
...
...
src/document/UBDocumentController.cpp
View file @
b8f006d1
...
...
@@ -1006,11 +1006,12 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document)
if
(
filePath
.
length
()
>
0
)
{
QApplication
::
processEvents
();
QFile
selectedFile
(
filePath
);
showMessage
(
tr
(
"Importing file %1..."
).
arg
(
fileInfo
.
baseName
()),
true
);
success
=
UBDocumentManager
::
documentManager
()
->
addFileToDocument
(
document
,
selectedFile
);
QStringList
fileNames
;
fileNames
<<
filePath
;
success
=
UBDocumentManager
::
documentManager
()
->
addFilesToDocument
(
document
,
fileNames
);
if
(
success
)
{
...
...
@@ -1438,7 +1439,7 @@ void UBDocumentController::addImages()
UBSettings
::
settings
()
->
lastImportFolderPath
->
set
(
QVariant
(
firstImage
.
absoluteDir
().
absolutePath
()));
int
importedImageNumber
=
UBDocumentManager
::
documentManager
()
->
addImageAsPageToDocument
(
images
,
document
);
=
UBDocumentManager
::
documentManager
()
->
addFilesToDocument
(
document
,
images
);
if
(
importedImageNumber
==
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment