From 5eb72a029776ba1e28ffbc98434e33a995dd7ab7 Mon Sep 17 00:00:00 2001 From: Ivandro Ismael Date: Thu, 17 Nov 2016 16:50:46 +0000 Subject: [PATCH] [Settings] - Remove duplicates. --- src/Forms/Settings.cs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/Forms/Settings.cs b/src/Forms/Settings.cs index 4c603f740..394c2d46c 100644 --- a/src/Forms/Settings.cs +++ b/src/Forms/Settings.cs @@ -981,39 +981,23 @@ namespace Nikse.SubtitleEdit.Forms { if (!cultures.Contains(culture)) cultures.Add(culture); - } + } } } foreach (var culture in CultureInfo.GetCultures(CultureTypes.NeutralCultures)) { - if (Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + "_OCRFixReplaceList.xml").Length == 1) + if (Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + "_OCRFixReplaceList.xml").Length == 1 || + Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + "_OCRFixReplaceList_User.xml").Length == 1) { - bool found = false; foreach (var ci in cultures) { if (ci.ThreeLetterISOLanguageName == culture.ThreeLetterISOLanguageName) { - found = true; + cultures.Add(culture); break; } } - if (!found) - cultures.Add(culture); - } - else if (Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + "_OCRFixReplaceList_User.xml").Length == 1) - { - bool found = false; - foreach (var ci in cultures) - { - if (ci.ThreeLetterISOLanguageName == culture.ThreeLetterISOLanguageName) - { - found = true; - break; - } - } - if (!found) - cultures.Add(culture); } }