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
Show 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)
...
@@ -481,7 +481,7 @@ void UBBoardController::stylusToolDoubleClicked(int tool)
void
UBBoardController
::
addScene
()
void
UBBoardController
::
addScene
()
{
{
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
persistCurrentScene
();
persistCurrentScene
(
false
,
true
);
UBDocumentContainer
::
addPage
(
mActiveSceneIndex
+
1
);
UBDocumentContainer
::
addPage
(
mActiveSceneIndex
+
1
);
...
@@ -523,7 +523,7 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp
...
@@ -523,7 +523,7 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp
}
}
else
else
{
{
persistCurrentScene
();
persistCurrentScene
(
false
,
true
);
UBPersistenceManager
::
persistenceManager
()
->
insertDocumentSceneAt
(
selectedDocument
(),
clone
,
mActiveSceneIndex
+
1
);
UBPersistenceManager
::
persistenceManager
()
->
insertDocumentSceneAt
(
selectedDocument
(),
clone
,
mActiveSceneIndex
+
1
);
setActiveDocumentScene
(
mActiveSceneIndex
+
1
);
setActiveDocumentScene
(
mActiveSceneIndex
+
1
);
}
}
...
@@ -546,7 +546,7 @@ void UBBoardController::addScene(UBDocumentProxy* proxy, int sceneIndex, bool re
...
@@ -546,7 +546,7 @@ void UBBoardController::addScene(UBDocumentProxy* proxy, int sceneIndex, bool re
void
UBBoardController
::
duplicateScene
(
int
nIndex
)
void
UBBoardController
::
duplicateScene
(
int
nIndex
)
{
{
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
persistCurrentScene
();
persistCurrentScene
(
false
,
true
);
QList
<
int
>
scIndexes
;
QList
<
int
>
scIndexes
;
scIndexes
<<
nIndex
;
scIndexes
<<
nIndex
;
...
@@ -1538,7 +1538,7 @@ void UBBoardController::moveSceneToIndex(int source, int target)
...
@@ -1538,7 +1538,7 @@ void UBBoardController::moveSceneToIndex(int source, int target)
if
(
selectedDocument
())
if
(
selectedDocument
())
{
{
persistCurrentScene
();
persistCurrentScene
(
false
,
true
);
UBDocumentContainer
::
movePageToIndex
(
source
,
target
);
UBDocumentContainer
::
movePageToIndex
(
source
,
target
);
...
@@ -1890,14 +1890,14 @@ void UBBoardController::show()
...
@@ -1890,14 +1890,14 @@ void UBBoardController::show()
UBApplication
::
mainWindow
->
actionLibrary
->
setChecked
(
false
);
UBApplication
::
mainWindow
->
actionLibrary
->
setChecked
(
false
);
}
}
void
UBBoardController
::
persistCurrentScene
(
bool
isAnAutomaticBackup
)
void
UBBoardController
::
persistCurrentScene
(
bool
isAnAutomaticBackup
,
bool
forceImmediateSave
)
{
{
if
(
UBPersistenceManager
::
persistenceManager
()
if
(
UBPersistenceManager
::
persistenceManager
()
&&
selectedDocument
()
&&
mActiveScene
&&
mActiveSceneIndex
!=
mDeletingSceneIndex
&&
selectedDocument
()
&&
mActiveScene
&&
mActiveSceneIndex
!=
mDeletingSceneIndex
&&
(
mActiveSceneIndex
>=
0
)
&&
mActiveSceneIndex
!=
mMovingSceneIndex
&&
(
mActiveSceneIndex
>=
0
)
&&
mActiveSceneIndex
!=
mMovingSceneIndex
&&
(
mActiveScene
->
isModified
()))
&&
(
mActiveScene
->
isModified
()))
{
{
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
selectedDocument
(),
mActiveScene
,
mActiveSceneIndex
,
isAnAutomaticBackup
);
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
selectedDocument
(),
mActiveScene
,
mActiveSceneIndex
,
isAnAutomaticBackup
,
forceImmediateSave
);
updatePage
(
mActiveSceneIndex
);
updatePage
(
mActiveSceneIndex
);
}
}
}
}
...
...
src/board/UBBoardController.h
View file @
39a12840
...
@@ -156,7 +156,7 @@ class UBBoardController : public UBDocumentContainer
...
@@ -156,7 +156,7 @@ class UBBoardController : public UBDocumentContainer
return
mSystemScaleFactor
;
return
mSystemScaleFactor
;
}
}
qreal
currentZoom
();
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
showNewVersionAvailable
(
bool
automatic
,
const
UBVersion
&
installedVersion
,
const
UBSoftwareUpdate
&
softwareUpdate
);
void
setBoxing
(
QRect
displayRect
);
void
setBoxing
(
QRect
displayRect
);
void
setToolbarTexts
();
void
setToolbarTexts
();
...
...
src/core/UBPersistenceManager.cpp
View file @
39a12840
...
@@ -725,7 +725,7 @@ UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy,
...
@@ -725,7 +725,7 @@ UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy,
return
scene
;
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
();
checkIfDocumentRepositoryExists
();
...
@@ -745,13 +745,14 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
...
@@ -745,13 +745,14 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
if
(
pScene
->
isModified
())
if
(
pScene
->
isModified
())
{
{
UBThumbnailAdaptor
::
persistScene
(
pDocumentProxy
,
pScene
,
pSceneIndex
);
UBThumbnailAdaptor
::
persistScene
(
pDocumentProxy
,
pScene
,
pSceneIndex
);
QTime
time
;
if
(
forceImmediateSaving
)
time
.
start
();
UBSvgSubsetAdaptor
::
persistScene
(
pDocumentProxy
,
pScene
,
pSceneIndex
);
else
{
UBGraphicsScene
*
copiedScene
=
pScene
->
sceneDeepCopy
();
UBGraphicsScene
*
copiedScene
=
pScene
->
sceneDeepCopy
();
qDebug
()
<<
"time to duplicate scene "
<<
time
.
elapsed
()
<<
" ms"
;
mWorker
->
saveScene
(
pDocumentProxy
,
copiedScene
,
pSceneIndex
);
mWorker
->
saveScene
(
pDocumentProxy
,
copiedScene
,
pSceneIndex
);
pScene
->
setModified
(
false
);
pScene
->
setModified
(
false
);
}
}
}
}
}
...
@@ -909,9 +910,11 @@ bool UBPersistenceManager::isEmpty(UBDocumentProxy* pDocumentProxy)
...
@@ -909,9 +910,11 @@ bool UBPersistenceManager::isEmpty(UBDocumentProxy* pDocumentProxy)
if
(
theSoleScene
)
if
(
theSoleScene
)
{
{
empty
=
theSoleScene
->
isEmpty
();
empty
=
theSoleScene
->
isEmpty
();
if
(
empty
)
if
(
empty
){
mSceneCache
.
removeScene
(
pDocumentProxy
,
0
);
delete
theSoleScene
;
delete
theSoleScene
;
}
}
}
else
else
{
{
empty
=
true
;
empty
=
true
;
...
...
src/core/UBPersistenceManager.h
View file @
39a12840
...
@@ -75,7 +75,7 @@ class UBPersistenceManager : public QObject
...
@@ -75,7 +75,7 @@ class UBPersistenceManager : public QObject
virtual
void
duplicateDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
int
index
);
virtual
void
duplicateDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
int
index
);
virtual
void
persistDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
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
);
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