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
ee069c75
Commit
ee069c75
authored
10 years ago
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed with pixmap and svg not saved on disk when added from a capture
parent
bddb4db2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
37 deletions
+36
-37
UBBoardController.cpp
src/board/UBBoardController.cpp
+0
-37
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+36
-0
No files found.
src/board/UBBoardController.cpp
View file @
ee069c75
...
@@ -1104,21 +1104,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1104,21 +1104,6 @@ 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
);
...
@@ -1138,28 +1123,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1138,28 +1123,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
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
NULL
;
}
file
.
write
(
svgItem
->
fileData
());
file
.
close
();
}
svgItem
->
setSourceUrl
(
sourceUrl
);
svgItem
->
setSourceUrl
(
sourceUrl
);
if
(
isBackground
)
if
(
isBackground
)
...
...
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsScene.cpp
View file @
ee069c75
...
@@ -1291,6 +1291,20 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphi
...
@@ -1291,6 +1291,20 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphi
pixmapItem
->
show
();
pixmapItem
->
show
();
setDocumentUpdated
();
setDocumentUpdated
();
QString
documentPath
=
UBApplication
::
boardController
->
selectedDocument
()
->
persistencePath
();
QString
fileName
=
UBPersistenceManager
::
imageDirectory
+
"/"
+
pixmapItem
->
uuid
().
toString
()
+
".png"
;
QString
path
=
documentPath
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
path
))
{
QDir
dir
;
dir
.
mkdir
(
documentPath
+
"/"
+
UBPersistenceManager
::
imageDirectory
);
pixmapItem
->
pixmap
().
toImage
().
save
(
path
,
"PNG"
);
}
return
pixmapItem
;
return
pixmapItem
;
}
}
...
@@ -1537,6 +1551,28 @@ UBGraphicsSvgItem* UBGraphicsScene::addSvg(const QUrl& pSvgFileUrl, const QPoint
...
@@ -1537,6 +1551,28 @@ UBGraphicsSvgItem* UBGraphicsScene::addSvg(const QUrl& pSvgFileUrl, const QPoint
setDocumentUpdated
();
setDocumentUpdated
();
QString
documentPath
=
UBApplication
::
boardController
->
selectedDocument
()
->
persistencePath
();
QString
fileName
=
UBPersistenceManager
::
imageDirectory
+
"/"
+
svgItem
->
uuid
().
toString
()
+
".svg"
;
QString
completePath
=
documentPath
+
"/"
+
fileName
;
if
(
!
QFile
::
exists
(
completePath
))
{
QDir
dir
;
dir
.
mkdir
(
documentPath
+
"/"
+
UBPersistenceManager
::
imageDirectory
);
QFile
file
(
completePath
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
))
{
qWarning
()
<<
"cannot open file for writing embeded svg content "
<<
completePath
;
return
NULL
;
}
file
.
write
(
svgItem
->
fileData
());
file
.
close
();
}
return
svgItem
;
return
svgItem
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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