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
f49e2fa7
Commit
f49e2fa7
authored
Sep 24, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed import issue related to documents, without title page, imported at application start up
parent
807c68ea
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
UBImportDocument.cpp
src/adaptors/UBImportDocument.cpp
+5
-2
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+3
-2
UBPersistenceManager.h
src/core/UBPersistenceManager.h
+1
-1
main.cpp
src/core/main.cpp
+1
-1
No files found.
src/adaptors/UBImportDocument.cpp
View file @
f49e2fa7
...
...
@@ -171,8 +171,11 @@ UBDocumentProxy* UBImportDocument::importFile(const QFile& pFile, const QString&
return
NULL
;
}
bool
addTitlePage
=
false
;
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
->
get
().
toBool
()
&&
!
QFile
(
documentRootFolder
+
"/page000.svg"
).
exists
())
addTitlePage
=
true
;
UBDocumentProxy
*
newDocument
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentFromDir
(
documentRootFolder
,
pGroup
);
UBDocumentProxy
*
newDocument
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentFromDir
(
documentRootFolder
,
pGroup
,
""
,
false
,
addTitlePage
);
UBApplication
::
showMessage
(
tr
(
"Import successful."
));
return
newDocument
;
}
...
...
src/core/UBPersistenceManager.cpp
View file @
f49e2fa7
...
...
@@ -265,7 +265,7 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName,
return
doc
;
}
UBDocumentProxy
*
UBPersistenceManager
::
createDocumentFromDir
(
const
QString
&
pDocumentDirectory
,
const
QString
&
pGroupName
,
const
QString
&
pName
,
bool
withEmptyPage
)
UBDocumentProxy
*
UBPersistenceManager
::
createDocumentFromDir
(
const
QString
&
pDocumentDirectory
,
const
QString
&
pGroupName
,
const
QString
&
pName
,
bool
withEmptyPage
,
bool
addTitlePage
)
{
checkIfDocumentRepositoryExists
();
...
...
@@ -280,7 +280,8 @@ UBDocumentProxy* UBPersistenceManager::createDocumentFromDir(const QString& pDoc
{
doc
->
setMetaData
(
UBSettings
::
documentName
,
pName
);
}
if
(
withEmptyPage
)
createDocumentSceneAt
(
doc
,
0
);
if
(
withEmptyPage
)
createDocumentSceneAt
(
doc
,
0
);
if
(
addTitlePage
)
persistDocumentScene
(
doc
,
mSceneCache
.
createScene
(
doc
,
0
,
false
),
0
);
QMap
<
QString
,
QVariant
>
metadatas
=
UBMetadataDcSubsetAdaptor
::
load
(
pDocumentDirectory
);
...
...
src/core/UBPersistenceManager.h
View file @
f49e2fa7
...
...
@@ -47,7 +47,7 @@ class UBPersistenceManager : public QObject
static
void
destroy
();
virtual
UBDocumentProxy
*
createDocument
(
const
QString
&
pGroupName
=
""
,
const
QString
&
pName
=
""
,
bool
withEmptyPage
=
true
);
virtual
UBDocumentProxy
*
createDocumentFromDir
(
const
QString
&
pDocumentDirectory
,
const
QString
&
pGroupName
=
""
,
const
QString
&
pName
=
""
,
bool
withEmptyPage
=
false
);
virtual
UBDocumentProxy
*
createDocumentFromDir
(
const
QString
&
pDocumentDirectory
,
const
QString
&
pGroupName
=
""
,
const
QString
&
pName
=
""
,
bool
withEmptyPage
=
false
,
bool
addTitlePage
=
false
);
virtual
UBDocumentProxy
*
persistDocumentMetadata
(
UBDocumentProxy
*
pDocumentProxy
);
...
...
src/core/main.cpp
View file @
f49e2fa7
...
...
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
QObject
::
connect
(
&
app
,
SIGNAL
(
messageReceived
(
const
QString
&
)),
&
app
,
SLOT
(
handleOpenMessage
(
const
QString
&
)));
qDebug
()
<<
fileToOpen
;
qDebug
()
<<
"file name argument"
<<
fileToOpen
;
int
result
=
app
.
exec
(
fileToOpen
);
app
.
cleanup
();
...
...
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