mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-12 21:21:05 +00:00
GUI: track name recognition: optionally anchor at beginning of name
This commit is contained in:
parent
1af71c6286
commit
d9fda168a7
@ -395,7 +395,7 @@ SourceFile::setupProgramMapFromProperties() {
|
||||
|
||||
QString
|
||||
SourceFile::defaultRegexForDerivingLanguageFromFileName() {
|
||||
return Q("[[({.+=#-](<ISO_639_1_CODES>|<ISO_639_2_CODES>|<LANGUAGE_NAMES>)[])}.+=#-]");
|
||||
return Q("(?:^|[[({.+=#-])(<ISO_639_1_CODES>|<ISO_639_2_CODES>|<LANGUAGE_NAMES>)[])}.+=#-]");
|
||||
}
|
||||
|
||||
QRegularExpression
|
||||
|
@ -234,6 +234,20 @@ Settings::convertOldSettings() {
|
||||
reg->setValue(s_valMergeTrackPropertiesLayout, static_cast<int>(mergeUseVerticalInputLayout.toBool() ? TrackPropertiesLayout::VerticalTabWidget : TrackPropertiesLayout::HorizontalScrollArea));
|
||||
|
||||
reg->endGroup();
|
||||
|
||||
// Replace default track name recognition regex valid up to 36.0.0
|
||||
// with new default one. Empty value will be replaced with actual
|
||||
// new default later.
|
||||
reg->beginGroup(s_grpSettings);
|
||||
reg->beginGroup(s_grpDerivingTrackLanguagesFromFileNames);
|
||||
auto val = reg->value(s_valCustomRegex).toString();
|
||||
|
||||
// writtenByVersion ≤ 36.0.0 → !(writtenByVersion > 36.0.0)
|
||||
if ( !(version_number_t{"36"} < writtenByVersion)
|
||||
&& (val == Q("[[({.+=#-](<ISO_639_1_CODES>|<ISO_639_2_CODES>|<LANGUAGE_NAMES>)[])}.+=#-]")))
|
||||
reg->remove(s_valCustomRegex);
|
||||
reg->endGroup();
|
||||
reg->endGroup();
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user