diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index e83414f7..3a6a2394 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -645,7 +645,7 @@ void UBBoardController::duplicateItem(UBItem *item) { mActiveScene->addItem(gitem); gitem->setPos(itemPos); - mLastCreatedItem = gitem; + mLastCreatedItem = gitem; gitem->setSelected(true); } return; @@ -1132,7 +1132,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri QString destFile; bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(), - "", + sourceUrl.toString(), UBPersistenceManager::videoDirectory, uuid, destFile, @@ -1175,7 +1175,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri QString destFile; bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(), - "", + sourceUrl.toString(), UBPersistenceManager::audioDirectory, uuid, destFile, diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 2c025a7c..62c1aca0 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -913,6 +913,7 @@ bool UBPersistenceManager::addFileToDocument(UBDocumentProxy* pDocumentProxy, QString& destinationPath, QByteArray* data) { + QAssert(path.length()); QFileInfo fi(path); if (!pDocumentProxy || objectUuid.isNull()) @@ -920,6 +921,8 @@ 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;