|
|
@ -272,13 +272,23 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName, |
|
|
|
return doc; |
|
|
|
return doc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBDocumentProxy* UBPersistenceManager::createDocumentFromDir(const QString& pDocumentDirectory, const QString& pGroupName, const QString& pName, bool withEmptyPage) |
|
|
|
UBDocumentProxy* UBPersistenceManager::createDocumentFromDir(const QString& pDocumentDirectory) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
checkIfDocumentRepositoryExists(); |
|
|
|
checkIfDocumentRepositoryExists(); |
|
|
|
|
|
|
|
|
|
|
|
UBDocumentProxy* doc = new UBDocumentProxy(pDocumentDirectory); // deleted in UBPersistenceManager::destructor
|
|
|
|
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); |
|
|
|
QMap<QString, QVariant> metadatas = UBMetadataDcSubsetAdaptor::load(pDocumentDirectory); |
|
|
|
|
|
|
|
|
|
|
|
foreach(QString key, metadatas.keys()) |
|
|
|
foreach(QString key, metadatas.keys()) |
|
|
|