Mercurial > hg > easaier-soundaccess
changeset 259:6f798a3571b0
correct bug if available_as property is not present in the result
author | lbajardsilogic |
---|---|
date | Fri, 20 Jun 2008 07:28:43 +0000 |
parents | 14e8a46d506d |
children | a1b892b92a40 |
files | sv/main/EasaierSessionManager.cpp |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/sv/main/EasaierSessionManager.cpp Fri Jun 20 07:26:03 2008 +0000 +++ b/sv/main/EasaierSessionManager.cpp Fri Jun 20 07:28:43 2008 +0000 @@ -302,7 +302,7 @@ m_audioSourceInfoModel = new AudioSourceInfoModel(); AudioSourceInfoReader audioSourceInfoReader(m_audioSourceInfoModel); read = audioSourceInfoReader.parse(filename); - if (read) + if (read && !m_audioSourceInfoModel->isEmpty() ) { m_document->setAudioSourceInfoModel(m_audioSourceInfoModel); loadRelatedModel(); @@ -409,7 +409,10 @@ if (modelName != "") { - QString uri = m_audioSourceInfoModel->getInfo(modelName)->at(0); + QStringList* uriList = m_audioSourceInfoModel->getInfo(modelName); + if (!uriList) + return; + QString uri = uriList->at(0); uri.remove("file:/"); uri.replace(".wma", ".mp3"); @@ -453,6 +456,7 @@ if (iterModel == addedModel.end()) { QString extension = filename.right(filename.length()-filename.lastIndexOf(".")-1); + extension = extension.toLower(); if (AudioFileReaderFactory::isKnownExtensions(extension)) { WaveFileModel *model = new WaveFileModel(filename);