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:
parent
992b21a3d0
commit
dcca2f0dd0
@ -51,11 +51,14 @@ protected:
|
||||
if(file->open(QIODevice::ReadOnly))
|
||||
{
|
||||
m_fileHandle = file;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning("[ArtworkModel] Failed to open artwork file!");
|
||||
LAMEXP_DELETE(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
~ArtworkModel_SharedData(void)
|
||||
{
|
||||
@ -86,11 +89,18 @@ protected:
|
||||
if(*ptr)
|
||||
{
|
||||
QMutexLocker lock(&s_mutex);
|
||||
if((*ptr)->m_referenceCounter > 0)
|
||||
{
|
||||
(*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);
|
||||
if(!newPath.isEmpty())
|
||||
{
|
||||
m_data = new ArtworkModel_SharedData(newPath, isOwner);
|
||||
}
|
||||
}
|
||||
|
||||
void ArtworkModel::clear(void)
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user