importing pdf doesn't add a blanc page anymore. Issue 81

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 2dbade1a79
commit f973c8b2d2
  1. 2
      src/core/UBDocumentManager.cpp
  2. 10
      src/core/UBPersistenceManager.cpp
  3. 1
      src/document/UBDocumentController.cpp

@ -150,7 +150,7 @@ UBDocumentProxy* UBDocumentManager::importFile(const QFile& pFile, const QString
// Document import procedure.....
QString documentName = QFileInfo(pFile.fileName()).completeBaseName();
document = UBPersistenceManager::persistenceManager()->createDocument(pGroup, documentName);
document = UBPersistenceManager::persistenceManager()->createDocument(pGroup, documentName,false);
QUuid uuid = QUuid::createUuid();
QString filepath = pFile.fileName();

@ -264,7 +264,10 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName,
doc->setMetaData(UBSettings::documentUpdatedAt,currentDate);
doc->setMetaData(UBSettings::documentDate,currentDate);
if (withEmptyPage) createDocumentSceneAt(doc, 0);
if (withEmptyPage)
createDocumentSceneAt(doc, 0);
else
generatePathIfNeeded(doc);
documentProxies.insert(0, QPointer<UBDocumentProxy>(doc));
@ -887,16 +890,13 @@ bool UBPersistenceManager::addFileToDocument(UBDocumentProxy* pDocumentProxy,
if (data == NULL && !fi.exists())
return false;
qDebug() << fi.suffix();
QString fileName = subdir + "/" + objectUuid.toString() + "." + fi.suffix();
destinationPath = pDocumentProxy->persistencePath() + "/" + fileName;
if (!QFile::exists(destinationPath))
{
QDir dir;
dir.mkdir(pDocumentProxy->persistencePath() + "/" + subdir);
dir.mkpath(pDocumentProxy->persistencePath() + "/" + subdir);
if (!QFile::exists(pDocumentProxy->persistencePath() + "/" + subdir))
return false;

@ -1052,7 +1052,6 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document)
if (filePath.length() > 0)
{
QApplication::processEvents(); // NOTE: We performed this just a few lines before. Is it really necessary to do it again here??
QFile selectedFile(filePath);
showMessage(tr("Importing file %1...").arg(fileInfo.baseName()), true);

Loading…
Cancel
Save