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
dbc0f592
Commit
dbc0f592
authored
Apr 11, 2014
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
images are stored on disk when downloaded on the board
parent
cf9d3850
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
32 deletions
+39
-32
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+1
-32
UBBoardController.cpp
src/board/UBBoardController.cpp
+38
-0
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
dbc0f592
...
@@ -1863,14 +1863,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::pixmapItemToLinkedImage(UBGraphicsPi
...
@@ -1863,14 +1863,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::pixmapItemToLinkedImage(UBGraphicsPi
QString
path
=
mDocumentPath
+
"/"
+
fileName
;
QString
path
=
mDocumentPath
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
path
))
{
QDir
dir
;
dir
.
mkdir
(
mDocumentPath
+
"/"
+
UBPersistenceManager
::
imageDirectory
);
pixmapItem
->
pixmap
().
toImage
().
save
(
path
,
"PNG"
);
}
mXmlWriter
.
writeAttribute
(
nsXLink
,
"href"
,
fileName
);
mXmlWriter
.
writeAttribute
(
nsXLink
,
"href"
,
fileName
);
graphicsItemToSvg
(
pixmapItem
);
graphicsItemToSvg
(
pixmapItem
);
...
@@ -1910,25 +1902,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::svgItemToLinkedSvg(UBGraphicsSvgItem
...
@@ -1910,25 +1902,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::svgItemToLinkedSvg(UBGraphicsSvgItem
mXmlWriter
.
writeStartElement
(
"image"
);
mXmlWriter
.
writeStartElement
(
"image"
);
QString
fileName
=
UBPersistenceManager
::
imageDirectory
+
"/"
+
svgItem
->
uuid
().
toString
()
+
".svg"
;
QString
path
=
mDocumentPath
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
path
))
{
QDir
dir
;
dir
.
mkdir
(
mDocumentPath
+
"/"
+
UBPersistenceManager
::
imageDirectory
);
QFile
file
(
path
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
))
{
qWarning
()
<<
"cannot open file for writing embeded svg content "
<<
path
;
return
;
}
file
.
write
(
svgItem
->
fileData
());
}
mXmlWriter
.
writeAttribute
(
nsXLink
,
"href"
,
fileName
);
mXmlWriter
.
writeAttribute
(
nsXLink
,
"href"
,
fileName
);
graphicsItemToSvg
(
svgItem
);
graphicsItemToSvg
(
svgItem
);
...
@@ -1984,6 +1957,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::pdfItemToLinkedPDF(UBGraphicsPDFItem
...
@@ -1984,6 +1957,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::pdfItemToLinkedPDF(UBGraphicsPDFItem
}
}
file
.
write
(
pdfItem
->
fileData
());
file
.
write
(
pdfItem
->
fileData
());
file
.
close
();
}
}
mXmlWriter
.
writeAttribute
(
nsXLink
,
"href"
,
fileName
+
"#page="
+
QString
::
number
(
pdfItem
->
pageNumber
()));
mXmlWriter
.
writeAttribute
(
nsXLink
,
"href"
,
fileName
+
"#page="
+
QString
::
number
(
pdfItem
->
pageNumber
()));
...
@@ -2344,11 +2318,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsWidgetToSvg(UBGraphicsWidget
...
@@ -2344,11 +2318,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsWidgetToSvg(UBGraphicsWidget
mXmlWriter
.
writeAttribute
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"frozen"
,
xmlTrue
);
mXmlWriter
.
writeAttribute
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"frozen"
,
xmlTrue
);
}
}
// QString snapshotPath = mDocumentPath + "/" + UBPersistenceManager::widgetDirectory + "/" + uuid + ".png";
// item->takeSnapshot().save(snapshotPath, "PNG");
mXmlWriter
.
writeStartElement
(
nsXHtml
,
"iframe"
);
mXmlWriter
.
writeStartElement
(
nsXHtml
,
"iframe"
);
mXmlWriter
.
writeAttribute
(
"style"
,
"border: none"
);
mXmlWriter
.
writeAttribute
(
"style"
,
"border: none"
);
...
...
src/board/UBBoardController.cpp
View file @
dbc0f592
...
@@ -1105,6 +1105,21 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1105,6 +1105,21 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
UBGraphicsPixmapItem
*
pixItem
=
mActiveScene
->
addPixmap
(
pix
,
NULL
,
pPos
,
1.
);
UBGraphicsPixmapItem
*
pixItem
=
mActiveScene
->
addPixmap
(
pix
,
NULL
,
pPos
,
1.
);
pixItem
->
setSourceUrl
(
sourceUrl
);
pixItem
->
setSourceUrl
(
sourceUrl
);
QString
documentPath
=
UBApplication
::
boardController
->
selectedDocument
()
->
persistencePath
();
QString
fileName
=
UBPersistenceManager
::
imageDirectory
+
"/"
+
pixItem
->
uuid
().
toString
()
+
".png"
;
QString
path
=
documentPath
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
path
))
{
QDir
dir
;
dir
.
mkdir
(
documentPath
+
"/"
+
UBPersistenceManager
::
imageDirectory
);
pixItem
->
pixmap
().
toImage
().
save
(
path
,
"PNG"
);
}
if
(
isBackground
)
if
(
isBackground
)
{
{
mActiveScene
->
setAsBackgroundObject
(
pixItem
,
true
);
mActiveScene
->
setAsBackgroundObject
(
pixItem
,
true
);
...
@@ -1123,6 +1138,29 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1123,6 +1138,29 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
qDebug
()
<<
"accepting mime type"
<<
mimeType
<<
"as vecto image"
;
qDebug
()
<<
"accepting mime type"
<<
mimeType
<<
"as vecto image"
;
UBGraphicsSvgItem
*
svgItem
=
mActiveScene
->
addSvg
(
sourceUrl
,
pPos
,
pData
);
UBGraphicsSvgItem
*
svgItem
=
mActiveScene
->
addSvg
(
sourceUrl
,
pPos
,
pData
);
QString
documentPath
=
UBApplication
::
boardController
->
selectedDocument
()
->
persistencePath
();
QString
fileName
=
UBPersistenceManager
::
imageDirectory
+
"/"
+
svgItem
->
uuid
().
toString
()
+
".svg"
;
QString
path
=
documentPath
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
path
))
{
QDir
dir
;
dir
.
mkdir
(
documentPath
+
"/"
+
UBPersistenceManager
::
imageDirectory
);
QFile
file
(
path
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
))
{
qWarning
()
<<
"cannot open file for writing embeded svg content "
<<
path
;
return
;
}
file
.
write
(
svgItem
->
fileData
());
file
.
close
();
}
svgItem
->
setSourceUrl
(
sourceUrl
);
svgItem
->
setSourceUrl
(
sourceUrl
);
if
(
isBackground
)
if
(
isBackground
)
...
...
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