Fixed a bug that caused files to fail to convert when writing meta tags is disabled.

This commit is contained in:
LoRd_MuldeR 2011-02-06 17:34:14 +01:00
parent d9e775b4b8
commit 18bc47cb9a
4 changed files with 24 additions and 13 deletions

View File

@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 0 #define VER_LAMEXP_MINOR_LO 0
#define VER_LAMEXP_BUILD 290 #define VER_LAMEXP_BUILD 291
#define VER_LAMEXP_SUFFIX Beta-3 #define VER_LAMEXP_SUFFIX Beta-3
/* /*

View File

@ -596,7 +596,8 @@ AudioFileModel ProcessingDialog::updateMetaInfo(const AudioFileModel &audioFile)
{ {
if(!m_settings->writeMetaTags()) if(!m_settings->writeMetaTags())
{ {
return AudioFileModel(audioFile.filePath()); AudioFileModel result(audioFile, false);
return result;
} }
AudioFileModel result = audioFile; AudioFileModel result = audioFile;

View File

@ -40,18 +40,16 @@ AudioFileModel::AudioFileModel(const QString &path, const QString &name)
m_formatAudioBitdepth = 0; m_formatAudioBitdepth = 0;
} }
AudioFileModel::AudioFileModel(const AudioFileModel &model) AudioFileModel::AudioFileModel(const AudioFileModel &model, bool copyMetaInfo)
{ {
setFilePath(model.m_filePath); m_fileYear = 0;
setFileName(model.m_fileName); m_filePosition = 0;
setFileArtist(model.m_fileArtist); m_fileDuration = 0;
setFileAlbum(model.m_fileAlbum); m_formatAudioSamplerate = 0;
setFileGenre(model.m_fileGenre); m_formatAudioChannels = 0;
setFileComment(model.m_fileComment); m_formatAudioBitdepth = 0;
setFileYear(model.m_fileYear);
setFilePosition(model.m_filePosition);
setFileDuration(model.m_fileDuration);
setFilePath(model.m_filePath);
setFormatContainerType(model.m_formatContainerType); setFormatContainerType(model.m_formatContainerType);
setFormatContainerProfile(model.m_formatContainerProfile); setFormatContainerProfile(model.m_formatContainerProfile);
setFormatAudioType(model.m_formatAudioType); setFormatAudioType(model.m_formatAudioType);
@ -60,6 +58,18 @@ AudioFileModel::AudioFileModel(const AudioFileModel &model)
setFormatAudioSamplerate(model.m_formatAudioSamplerate); setFormatAudioSamplerate(model.m_formatAudioSamplerate);
setFormatAudioChannels(model.m_formatAudioChannels); setFormatAudioChannels(model.m_formatAudioChannels);
setFormatAudioBitdepth(model.m_formatAudioBitdepth); setFormatAudioBitdepth(model.m_formatAudioBitdepth);
setFileDuration(model.m_fileDuration);
if(copyMetaInfo)
{
setFileName(model.m_fileName);
setFileArtist(model.m_fileArtist);
setFileAlbum(model.m_fileAlbum);
setFileGenre(model.m_fileGenre);
setFileComment(model.m_fileComment);
setFileYear(model.m_fileYear);
setFilePosition(model.m_filePosition);
}
} }
AudioFileModel &AudioFileModel::operator=(const AudioFileModel &model) AudioFileModel &AudioFileModel::operator=(const AudioFileModel &model)

View File

@ -30,7 +30,7 @@ class AudioFileModel : public QObject
public: public:
AudioFileModel(const QString &path = QString(), const QString &name = QString()); AudioFileModel(const QString &path = QString(), const QString &name = QString());
AudioFileModel(const AudioFileModel &model); AudioFileModel(const AudioFileModel &model, bool copyMetaInfo = true);
AudioFileModel &operator=(const AudioFileModel &model); AudioFileModel &operator=(const AudioFileModel &model);
~AudioFileModel(void); ~AudioFileModel(void);