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
c4e771c8
Commit
c4e771c8
authored
Feb 08, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SANKORE-429
parent
b6604dce
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1579 additions
and
1567 deletions
+1579
-1567
UBImportDocument.cpp
src/adaptors/UBImportDocument.cpp
+219
-217
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+1185
-1175
UBPersistenceManager.h
src/core/UBPersistenceManager.h
+175
-175
No files found.
src/adaptors/UBImportDocument.cpp
View file @
c4e771c8
...
...
@@ -191,8 +191,10 @@ UBDocumentProxy* UBImportDocument::importFile(const QFile& pFile, const QString&
return
0
;
}
else
{
UBDocumentProxy
*
newDocument
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentFromDir
(
documentRootFolder
);
UBDocumentProxy
*
newDocument
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentFromDir
(
documentRootFolder
,
pGroup
);
UBApplication
::
showMessage
(
tr
(
"Import successful."
));
return
newDocument
;
}
}
...
...
src/core/UBPersistenceManager.cpp
View file @
c4e771c8
...
...
@@ -272,13 +272,23 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName,
return
doc
;
}
UBDocumentProxy
*
UBPersistenceManager
::
createDocumentFromDir
(
const
QString
&
pDocumentDirectory
)
UBDocumentProxy
*
UBPersistenceManager
::
createDocumentFromDir
(
const
QString
&
pDocumentDirectory
,
const
QString
&
pGroupName
,
const
QString
&
pName
,
bool
withEmptyPage
)
{
checkIfDocumentRepositoryExists
();
UBDocumentProxy
*
doc
=
new
UBDocumentProxy
(
pDocumentDirectory
);
// deleted in UBPersistenceManager::destructor
if
(
pGroupName
.
length
()
>
0
)
{
doc
->
setMetaData
(
UBSettings
::
documentGroupName
,
pGroupName
);
}
if
(
pName
.
length
()
>
0
)
{
doc
->
setMetaData
(
UBSettings
::
documentName
,
pName
);
}
if
(
withEmptyPage
)
createDocumentSceneAt
(
doc
,
0
);
QMap
<
QString
,
QVariant
>
metadatas
=
UBMetadataDcSubsetAdaptor
::
load
(
pDocumentDirectory
);
foreach
(
QString
key
,
metadatas
.
keys
())
...
...
src/core/UBPersistenceManager.h
View file @
c4e771c8
...
...
@@ -55,7 +55,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
);
virtual
UBDocumentProxy
*
createDocumentFromDir
(
const
QString
&
pDocumentDirectory
,
const
QString
&
pGroupName
=
""
,
const
QString
&
pName
=
""
,
bool
withEmptyPage
=
false
);
virtual
UBDocumentProxy
*
persistDocumentMetadata
(
UBDocumentProxy
*
pDocumentProxy
);
...
...
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