Merge branch 'OEFUniboard' of github.com:stayonshadow/PrivateBoard into OEFUniboard

preferencesAboutTextFull
Didier Clerc 11 years ago
commit e51b5dccae
  1. 2
      src/core/UBDocumentManager.cpp
  2. 10
      src/core/UBPersistenceManager.cpp
  3. 1
      src/document/UBDocumentController.cpp
  4. 2
      src/gui/UBDocumentNavigator.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);

@ -101,7 +101,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{
//claudio This is a very bad hack and shows a architectural problem
// source->selectedDocument()->pageCount() != source->pageCount()
if(i>=source->pageCount())
if(i>=source->pageCount() || source->pageAt(i)->isNull())
source->insertThumbPage(i);
const QPixmap* pix = source->pageAt(i);

Loading…
Cancel
Save