Fixed adding of found audio files to document.

Improved recognition of song's title.
Some code removed from header.
preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent 1ab1945f2e
commit ac1c9314ad
  1. 2
      src/board/UBBoardController.cpp
  2. 12
      src/domain/UBGraphicsMediaItem.cpp
  3. 11
      src/domain/UBGraphicsMediaItem.h

@ -1102,7 +1102,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
QUuid uuid = QUuid::createUuid();
QUrl url = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager()
->addVideoFileToDocument(selectedDocument(), sourceUrl, pData, uuid));
->addAudioFileToDocument(selectedDocument(), sourceUrl, pData, uuid));
audioMediaItem = mActiveScene->addMedia(url, false, pPos);

@ -178,6 +178,18 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
return UBGraphicsProxyWidget::itemChange(change, value);
}
void UBGraphicsMediaItem::setSourceUrl(const QUrl &pSourceUrl)
{
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toString()));
}
UBItem::setSourceUrl(pSourceUrl);
}
void UBGraphicsMediaItem::clearSource()
{
QString path = mediaFileUrl().toLocalFile();

@ -97,16 +97,7 @@ public:
virtual void copyItemParameters(UBItem *copy) const;
virtual void setSourceUrl(const QUrl &pSourceUrl)
{
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toLocalFile()));
}
UBItem::setSourceUrl(pSourceUrl);
}
virtual void setSourceUrl(const QUrl &pSourceUrl);
public slots:

Loading…
Cancel
Save