Commit 65ffaf9f authored by Claudio Valerio's avatar Claudio Valerio

fixed issue of empty document. In this case the metadata.rdf and the *.ubz are not created

parent 6d18c193
......@@ -68,12 +68,17 @@ UBMetadataDcSubsetAdaptor::~UBMetadataDcSubsetAdaptor()
void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
{
if(!QDir(proxy->persistencePath()).exists()){
//In this case the a document is an empty document so we do not persist it
return;
}
QString fileName = proxy->persistencePath() + "/" + metadataFilename;
qWarning() << fileName;
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate))
{
qCritical() << "cannot open " << fileName << " for writing ...";
qCritical() << "error : " << file.errorString();
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment