From 78f6727e889574dc5ea48e956e605c389d013129 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 4 Sep 2019 20:11:43 +0200 Subject: [PATCH] GUI: update often used languages to v37 built-ins if not modified by user The intention in v37 was to update both the setting "only include often used entries" and the list of often used languages at the same time, as long as the user hadn't modified that list. Unfortunately only the checkbox's default value was updated, but not the list. This lead to the confusing situation that suddenly only ~15 languages were shown in the drop-down boxes for users upgrading their installation, such as the person in #2611. New installations were not affected. --- NEWS.md | 4 ++++ src/mkvtoolnix-gui/util/settings.cpp | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/NEWS.md b/NEWS.md index 3d59a395d..c51bd0311 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,10 @@ * MKVToolNix GUI: Hebrew was added to the list of often-used languages so that it can be selected by default again. Fixes #2610. +* MKVToolNix GUI: when updating the GUI's settings from v37.0.0 or older, the + GUI checks if the list of often-used languages equals the built-in list from + v36.0.0. If it does, it will be updated to the built-in list changed in + v37.0.0. Fixes #2611. # Version 37.0.0 "Leave It" 2019-08-24 diff --git a/src/mkvtoolnix-gui/util/settings.cpp b/src/mkvtoolnix-gui/util/settings.cpp index ad3ebf642..2336b1f99 100644 --- a/src/mkvtoolnix-gui/util/settings.cpp +++ b/src/mkvtoolnix-gui/util/settings.cpp @@ -248,6 +248,18 @@ Settings::convertOldSettings() { reg->remove(s_valCustomRegex); reg->endGroup(); reg->endGroup(); + + // Update list of often-used language codes when updating from v37 + // or earlier & the list wasn't modified. + reg->beginGroup(s_grpSettings); + auto oftenUsedLanguages = reg->value(s_valOftenUsedLanguages).toStringList(); + oftenUsedLanguages.sort(); + + if ( !(version_number_t{"37"} < writtenByVersion) + && (oftenUsedLanguages == (QStringList{} << "chi" << "dut" << "eng" << "fin" << "fre" << "ger" << "ita" << "jpn" << "mul" << "nor" << "por" << "rus" << "spa" << "swe" << "und" << "zxx"))) + reg->remove(s_valOftenUsedLanguages); + + reg->endGroup(); } void