Fix copying a file's Meta Info into the Meta Data tab: Retain original "position" value rather than overwriting it.

This commit is contained in:
LoRd_MuldeR 2013-10-25 17:53:47 +02:00
parent dd98a78fad
commit 1b519d48c7
2 changed files with 6 additions and 0 deletions

View File

@ -2314,6 +2314,7 @@ void MainWindow::showDetailsButtonClicked(void)
iResult = metaInfoDialog->exec(file, index.row() > 0, index.row() < m_fileListModel->rowCount() - 1); iResult = metaInfoDialog->exec(file, index.row() > 0, index.row() < m_fileListModel->rowCount() - 1);
); );
//Copy all info to Meta Info tab
if(iResult == INT_MAX) if(iResult == INT_MAX)
{ {
m_metaInfoModel->assignInfoFrom(file); m_metaInfoModel->assignInfoFrom(file);

View File

@ -480,6 +480,11 @@ Qt::ItemFlags MetaInfoModel::flags(const QModelIndex &index) const
void MetaInfoModel::assignInfoFrom(const AudioFileModel &file) void MetaInfoModel::assignInfoFrom(const AudioFileModel &file)
{ {
beginResetModel(); beginResetModel();
const unsigned int position = m_metaInfo->position();
m_metaInfo->update(file.metaInfo(), true); m_metaInfo->update(file.metaInfo(), true);
if(m_offset)
{
m_metaInfo->setPosition(position ? UINT_MAX : 0);
}
endResetModel(); endResetModel();
} }