Save last used transcoder format with the mimetype instead of the extension.

ogg vorbis and ogg flac have the same extensions (*.ogg) and therefore the wrong item in the format combobox might be loaded.
This commit is contained in:
Andreas 2014-11-11 14:40:52 +01:00
parent 9cdb31c2d8
commit 8aa78af8f8
1 changed files with 3 additions and 3 deletions

View File

@ -76,10 +76,10 @@ TranscodeDialog::TranscodeDialog(QWidget* parent)
last_add_dir_ = s.value("last_add_dir", QDir::homePath()).toString();
last_import_dir_ = s.value("last_import_dir", QDir::homePath()).toString();
QString last_output_format = s.value("last_output_format", "ogg").toString();
QString last_output_format = s.value("last_output_format", "audio/x-vorbis").toString();
for (int i = 0; i < ui_->format->count(); ++i) {
if (last_output_format ==
ui_->format->itemData(i).value<TranscoderPreset>().extension_) {
ui_->format->itemData(i).value<TranscoderPreset>().codec_mimetype_) {
ui_->format->setCurrentIndex(i);
break;
}
@ -163,7 +163,7 @@ void TranscodeDialog::Start() {
// Save the last output format
QSettings s;
s.beginGroup(kSettingsGroup);
s.setValue("last_output_format", preset.extension_);
s.setValue("last_output_format", preset.codec_mimetype_);
}
void TranscodeDialog::Cancel() {