Do not set Title or Cover Art for the global meta info object, when assigning the info from a file.

This commit is contained in:
LoRd_MuldeR 2013-10-28 00:28:47 +01:00
parent 992b21a3d0
commit dcca2f0dd0
2 changed files with 21 additions and 6 deletions

View File

@ -51,9 +51,12 @@ protected:
if(file->open(QIODevice::ReadOnly))
{
m_fileHandle = file;
return;
}
LAMEXP_DELETE(file);
else
{
qWarning("[ArtworkModel] Failed to open artwork file!");
LAMEXP_DELETE(file);
}
}
}
@ -86,10 +89,17 @@ protected:
if(*ptr)
{
QMutexLocker lock(&s_mutex);
(*ptr)->m_referenceCounter = (*ptr)->m_referenceCounter - 1;
if((*ptr)->m_referenceCounter < 1)
if((*ptr)->m_referenceCounter > 0)
{
delete (*ptr);
(*ptr)->m_referenceCounter = (*ptr)->m_referenceCounter - 1;
if((*ptr)->m_referenceCounter < 1)
{
delete (*ptr);
}
}
else
{
qWarning("[ArtworkModel::detach] Ref counter already zero!");
}
*ptr = NULL;
}
@ -169,7 +179,10 @@ void ArtworkModel::setFilePath(const QString &newPath, bool isOwner)
{
QMutexLocker lock(m_mutex);
ArtworkModel_SharedData::detach(&m_data);
m_data = new ArtworkModel_SharedData(newPath, isOwner);
if(!newPath.isEmpty())
{
m_data = new ArtworkModel_SharedData(newPath, isOwner);
}
}
void ArtworkModel::clear(void)

View File

@ -484,7 +484,9 @@ void MetaInfoModel::assignInfoFrom(const AudioFileModel &file)
m_metaInfo->update(file.metaInfo(), true);
if(m_offset)
{
m_metaInfo->setTitle(QString());
m_metaInfo->setPosition(position ? UINT_MAX : 0);
m_metaInfo->setCover(QString(), false);
}
endResetModel();
}