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
fdc9e7ca
Commit
fdc9e7ca
authored
Jul 25, 2013
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Third step to fix the bug 27
parent
ea9ddcff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
31 deletions
+37
-31
UBImportAdaptor.cpp
src/adaptors/UBImportAdaptor.cpp
+0
-24
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+4
-2
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+32
-4
UBGraphicsWidgetItem.h
src/domain/UBGraphicsWidgetItem.h
+1
-1
No files found.
src/adaptors/UBImportAdaptor.cpp
View file @
fdc9e7ca
...
...
@@ -53,27 +53,3 @@ UBDocumentBasedImportAdaptor::UBDocumentBasedImportAdaptor(QObject *parent)
{
// NOOP
}
/*
UBDocumentProxy* UBImportAdaptor::importFile(const QFile& pFile, const QString& pGroup)
{
QString documentName = QFileInfo(pFile.fileName()).completeBaseName();
UBDocumentProxy* newDocument = UBPersistenceManager::persistenceManager()->createDocument(pGroup, documentName);
bool result = addFileToDocument(newDocument, pFile);
if (result)
{
UBPersistenceManager::persistenceManager()->persistDocumentMetadata(newDocument);
}
else
{
UBPersistenceManager::persistenceManager()->deleteDocument(newDocument);
newDocument = 0;
}
return newDocument;
}
*/
\ No newline at end of file
src/core/UBPersistenceManager.cpp
View file @
fdc9e7ca
...
...
@@ -255,7 +255,7 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName,
}
doc
->
setMetaData
(
UBSettings
::
documentVersion
,
UBSettings
::
currentFileVersion
);
QString
currentDate
=
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
());
QString
currentDate
=
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
());
doc
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
currentDate
);
doc
->
setMetaData
(
UBSettings
::
documentDate
,
currentDate
);
...
...
@@ -396,12 +396,14 @@ void UBPersistenceManager::deleteDocumentScenes(UBDocumentProxy* proxy, const QL
foreach
(
int
index
,
compactedIndexes
)
{
// trig the reload of the thumbnails
emit
documentSceneWillBeDeleted
(
proxy
,
index
);
}
QString
sourceGroupName
=
proxy
->
metaData
(
UBSettings
::
documentGroupName
).
toString
();
QString
sourceName
=
proxy
->
metaData
(
UBSettings
::
documentName
).
toString
();
UBDocumentProxy
*
trashDocProxy
=
createDocument
(
UBSettings
::
trashedDocumentGroupNamePrefix
+
sourceGroupName
,
sourceName
,
false
);
generatePathIfNeeded
(
trashDocProxy
);
foreach
(
int
index
,
compactedIndexes
)
{
...
...
@@ -418,7 +420,7 @@ void UBPersistenceManager::deleteDocumentScenes(UBDocumentProxy* proxy, const QL
QDir
d
=
fi
.
dir
();
d
.
mkpath
(
d
.
absolutePath
());
Q
File
::
copy
(
source
,
target
);
Q
_ASSERT
(
QFile
::
rename
(
source
,
target
)
);
}
insertDocumentSceneAt
(
trashDocProxy
,
scene
,
trashDocProxy
->
pageCount
());
...
...
src/domain/UBGraphicsScene.cpp
View file @
fdc9e7ca
...
...
@@ -2088,11 +2088,39 @@ QList<QUrl> UBGraphicsScene::relativeDependencies() const
while
(
itItems
.
hasNext
())
{
UBGraphicsMediaItem
*
videoItem
=
qgraphicsitem_cast
<
UBGraphicsMediaItem
*>
(
itItems
.
next
());
QGraphicsItem
*
item
=
itItems
.
next
();
UBGraphicsMediaItem
*
mediaItem
=
qgraphicsitem_cast
<
UBGraphicsMediaItem
*>
(
item
);
if
(
videoItem
&&
videoItem
->
mediaFileUrl
().
isRelative
())
{
relativePathes
<<
videoItem
->
mediaFileUrl
();
if
(
mediaItem
){
QString
completeFileName
=
QFileInfo
(
mediaItem
->
mediaFileUrl
().
toLocalFile
()).
fileName
();
QString
path
;
if
(
mediaItem
->
getMediaType
()
==
UBGraphicsMediaItem
::
mediaType_Video
)
path
=
UBPersistenceManager
::
videoDirectory
+
"/"
;
else
path
=
UBPersistenceManager
::
audioDirectory
+
"/"
;
relativePathes
<<
QUrl
(
path
+
completeFileName
);
continue
;
}
UBGraphicsWidgetItem
*
widget
=
qgraphicsitem_cast
<
UBGraphicsWidgetItem
*>
(
item
);
if
(
widget
){
QString
widgetPath
=
UBPersistenceManager
::
widgetDirectory
+
"/"
+
widget
->
uuid
().
toString
()
+
".wgt"
;
QString
screenshotPath
=
UBPersistenceManager
::
widgetDirectory
+
"/"
+
widget
->
uuid
().
toString
().
remove
(
"{"
).
remove
(
"}"
)
+
".png"
;
relativePathes
<<
QUrl
(
widgetPath
);
relativePathes
<<
QUrl
(
screenshotPath
);
continue
;
}
UBGraphicsPixmapItem
*
pixmapItem
=
qgraphicsitem_cast
<
UBGraphicsPixmapItem
*>
(
item
);
if
(
pixmapItem
){
relativePathes
<<
QUrl
(
UBPersistenceManager
::
imageDirectory
+
"/"
+
pixmapItem
->
uuid
().
toString
()
+
".png"
);
continue
;
}
UBGraphicsSvgItem
*
svgItem
=
qgraphicsitem_cast
<
UBGraphicsSvgItem
*>
(
item
);
if
(
svgItem
){
relativePathes
<<
QUrl
(
UBPersistenceManager
::
imageDirectory
+
"/"
+
svgItem
->
uuid
().
toString
()
+
".svg"
);
continue
;
}
}
...
...
src/domain/UBGraphicsWidgetItem.h
View file @
fdc9e7ca
...
...
@@ -130,7 +130,7 @@ class UBGraphicsWidgetItem : public QGraphicsWebView, public UBItem, public UBRe
type_WIN
=
1
,
// 0001
type_MAC
=
2
,
// 0010
type_UNIX
=
4
,
// 0100
type_ALL
=
7
,
// 0111
type_ALL
=
7
// 0111
};
bool
mFirstReleaseAfterMove
;
...
...
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