fixed audio path issue

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 322daf9461
commit aef7e56e01
  1. 5
      src/adaptors/UBCFFSubsetAdaptor.cpp
  2. 2
      src/adaptors/UBSvgSubsetAdaptor.cpp
  3. 6
      src/board/UBBoardController.cpp
  4. 5
      src/core/UBPersistenceManager.cpp

@ -815,13 +815,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgAudio(const QDomElement &ele
QUuid uuid = QUuid::createUuid(); QUuid uuid = QUuid::createUuid();
#ifdef Q_WS_X11
concreteUrl = QUrl::fromLocalFile(mCurrentScene->document()->persistencePath() + "/" + UBPersistenceManager::persistenceManager()
->addAudioFileToDocument(mCurrentScene->document(), concreteUrl.toLocalFile(), uuid));
#else
concreteUrl = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager() concreteUrl = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager()
->addAudioFileToDocument(mCurrentScene->document(), concreteUrl.toLocalFile(), uuid)); ->addAudioFileToDocument(mCurrentScene->document(), concreteUrl.toLocalFile(), uuid));
#endif
UBGraphicsAudioItem *audioItem = mCurrentScene->addAudio(concreteUrl, false); UBGraphicsAudioItem *audioItem = mCurrentScene->addAudio(concreteUrl, false);
QTransform transform; QTransform transform;

@ -1806,6 +1806,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::audioItemToLinkedAudio(UBGraphicsAud
} }
QString audioFileHref = audioItem->mediaFileUrl().toString(); QString audioFileHref = audioItem->mediaFileUrl().toString();
if(audioFileHref.startsWith("file://"))
audioFileHref = audioFileHref.replace("file://" + mDocumentPath + "/","");
mXmlWriter.writeAttribute(nsXLink, "href", audioFileHref); mXmlWriter.writeAttribute(nsXLink, "href", audioFileHref);
mXmlWriter.writeEndElement(); mXmlWriter.writeEndElement();
} }

@ -934,7 +934,6 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
QUrl url = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager() QUrl url = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager()
->addAudioFileToDocument(mActiveDocument, sourceUrl, pData, uuid)); ->addAudioFileToDocument(mActiveDocument, sourceUrl, pData, uuid));
audioItem = mActiveScene->addAudio(url, false, pPos); audioItem = mActiveScene->addAudio(url, false, pPos);
audioItem->setSourceUrl(sourceUrl); audioItem->setSourceUrl(sourceUrl);
@ -1779,13 +1778,8 @@ UBGraphicsAudioItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool st
QUuid uuid = QUuid::createUuid(); QUuid uuid = QUuid::createUuid();
QUrl concreteUrl = pSourceUrl; QUrl concreteUrl = pSourceUrl;
#ifdef Q_WS_X11
concreteUrl = QUrl::fromLocalFile(mActiveDocument->persistencePath() + "/" + UBPersistenceManager::persistenceManager()
->addAudioFileToDocument(mActiveDocument, pSourceUrl.toLocalFile(), uuid));
#else
concreteUrl = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager() concreteUrl = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager()
->addAudioFileToDocument(mActiveDocument, pSourceUrl.toLocalFile(), uuid)); ->addAudioFileToDocument(mActiveDocument, pSourceUrl.toLocalFile(), uuid));
#endif
UBGraphicsAudioItem* vi = mActiveScene->addAudio(concreteUrl, startPlay, pos); UBGraphicsAudioItem* vi = mActiveScene->addAudio(concreteUrl, startPlay, pos);
mActiveDocument->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); mActiveDocument->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));

@ -900,7 +900,7 @@ QString UBPersistenceManager::addAudioFileToDocument(UBDocumentProxy* pDocumentP
} }
return fileName; return destPath;
} }
@ -932,7 +932,8 @@ QString UBPersistenceManager::addAudioFileToDocument(UBDocumentProxy* pDocumentP
} }
} }
return fileName; //return fileName;
return destPath;
} }

Loading…
Cancel
Save