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
39a12840
Commit
39a12840
authored
Apr 10, 2014
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
duplication fixed. Crash on closing the application after creating a new document fixed.
parent
98e4abb7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
16 deletions
+19
-16
UBBoardController.cpp
src/board/UBBoardController.cpp
+6
-6
UBBoardController.h
src/board/UBBoardController.h
+1
-1
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+11
-8
UBPersistenceManager.h
src/core/UBPersistenceManager.h
+1
-1
No files found.
src/board/UBBoardController.cpp
View file @
39a12840
...
...
@@ -481,7 +481,7 @@ void UBBoardController::stylusToolDoubleClicked(int tool)
void
UBBoardController
::
addScene
()
{
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
persistCurrentScene
();
persistCurrentScene
(
false
,
true
);
UBDocumentContainer
::
addPage
(
mActiveSceneIndex
+
1
);
...
...
@@ -523,7 +523,7 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp
}
else
{
persistCurrentScene
();
persistCurrentScene
(
false
,
true
);
UBPersistenceManager
::
persistenceManager
()
->
insertDocumentSceneAt
(
selectedDocument
(),
clone
,
mActiveSceneIndex
+
1
);
setActiveDocumentScene
(
mActiveSceneIndex
+
1
);
}
...
...
@@ -546,7 +546,7 @@ void UBBoardController::addScene(UBDocumentProxy* proxy, int sceneIndex, bool re
void
UBBoardController
::
duplicateScene
(
int
nIndex
)
{
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
persistCurrentScene
();
persistCurrentScene
(
false
,
true
);
QList
<
int
>
scIndexes
;
scIndexes
<<
nIndex
;
...
...
@@ -1538,7 +1538,7 @@ void UBBoardController::moveSceneToIndex(int source, int target)
if
(
selectedDocument
())
{
persistCurrentScene
();
persistCurrentScene
(
false
,
true
);
UBDocumentContainer
::
movePageToIndex
(
source
,
target
);
...
...
@@ -1890,14 +1890,14 @@ void UBBoardController::show()
UBApplication
::
mainWindow
->
actionLibrary
->
setChecked
(
false
);
}
void
UBBoardController
::
persistCurrentScene
(
bool
isAnAutomaticBackup
)
void
UBBoardController
::
persistCurrentScene
(
bool
isAnAutomaticBackup
,
bool
forceImmediateSave
)
{
if
(
UBPersistenceManager
::
persistenceManager
()
&&
selectedDocument
()
&&
mActiveScene
&&
mActiveSceneIndex
!=
mDeletingSceneIndex
&&
(
mActiveSceneIndex
>=
0
)
&&
mActiveSceneIndex
!=
mMovingSceneIndex
&&
(
mActiveScene
->
isModified
()))
{
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
selectedDocument
(),
mActiveScene
,
mActiveSceneIndex
,
isAnAutomaticBackup
);
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
selectedDocument
(),
mActiveScene
,
mActiveSceneIndex
,
isAnAutomaticBackup
,
forceImmediateSave
);
updatePage
(
mActiveSceneIndex
);
}
}
...
...
src/board/UBBoardController.h
View file @
39a12840
...
...
@@ -156,7 +156,7 @@ class UBBoardController : public UBDocumentContainer
return
mSystemScaleFactor
;
}
qreal
currentZoom
();
void
persistCurrentScene
(
bool
isAnAutomaticBackup
=
false
);
void
persistCurrentScene
(
bool
isAnAutomaticBackup
=
false
,
bool
forceImmediateSave
=
false
);
void
showNewVersionAvailable
(
bool
automatic
,
const
UBVersion
&
installedVersion
,
const
UBSoftwareUpdate
&
softwareUpdate
);
void
setBoxing
(
QRect
displayRect
);
void
setToolbarTexts
();
...
...
src/core/UBPersistenceManager.cpp
View file @
39a12840
...
...
@@ -725,7 +725,7 @@ UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy,
return
scene
;
}
void
UBPersistenceManager
::
persistDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
UBGraphicsScene
*
pScene
,
const
int
pSceneIndex
,
bool
isAnAutomaticBackup
)
void
UBPersistenceManager
::
persistDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
UBGraphicsScene
*
pScene
,
const
int
pSceneIndex
,
bool
isAnAutomaticBackup
,
bool
forceImmediateSaving
)
{
checkIfDocumentRepositoryExists
();
...
...
@@ -745,12 +745,13 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
if
(
pScene
->
isModified
())
{
UBThumbnailAdaptor
::
persistScene
(
pDocumentProxy
,
pScene
,
pSceneIndex
);
QTime
time
;
time
.
start
();
UBGraphicsScene
*
copiedScene
=
pScene
->
sceneDeepCopy
();
qDebug
()
<<
"time to duplicate scene "
<<
time
.
elapsed
()
<<
" ms"
;
mWorker
->
saveScene
(
pDocumentProxy
,
copiedScene
,
pSceneIndex
);
pScene
->
setModified
(
false
);
if
(
forceImmediateSaving
)
UBSvgSubsetAdaptor
::
persistScene
(
pDocumentProxy
,
pScene
,
pSceneIndex
);
else
{
UBGraphicsScene
*
copiedScene
=
pScene
->
sceneDeepCopy
();
mWorker
->
saveScene
(
pDocumentProxy
,
copiedScene
,
pSceneIndex
);
pScene
->
setModified
(
false
);
}
}
}
...
...
@@ -909,8 +910,10 @@ bool UBPersistenceManager::isEmpty(UBDocumentProxy* pDocumentProxy)
if
(
theSoleScene
)
{
empty
=
theSoleScene
->
isEmpty
();
if
(
empty
)
if
(
empty
){
mSceneCache
.
removeScene
(
pDocumentProxy
,
0
);
delete
theSoleScene
;
}
}
else
{
...
...
src/core/UBPersistenceManager.h
View file @
39a12840
...
...
@@ -75,7 +75,7 @@ class UBPersistenceManager : public QObject
virtual
void
duplicateDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
int
index
);
virtual
void
persistDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
UBGraphicsScene
*
pScene
,
const
int
pSceneIndex
,
bool
isAnAutomaticBackup
=
false
);
UBGraphicsScene
*
pScene
,
const
int
pSceneIndex
,
bool
isAnAutomaticBackup
=
false
,
bool
forceImmediateSaving
=
false
);
virtual
UBGraphicsScene
*
createDocumentSceneAt
(
UBDocumentProxy
*
pDocumentProxy
,
int
index
,
bool
useUndoRedoStack
=
true
);
...
...
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