Skip to content
This repository
Browse code

settings: fix fallback of language region filler

  • Loading branch information...
commit a391051fddef8032219bfb326303a0ed478c755e 1 parent 9ac3e4c
Sascha Montellese authored

Showing 1 changed file with 14 additions and 1 deletion. Show diff stats Hide diff stats

  1. 15  xbmc/LangInfo.cpp
15  xbmc/LangInfo.cpp
@@ -613,8 +613,21 @@ void CLangInfo::SettingOptionsRegionsFiller(const CSetting *setting, std::vector
613 613
   g_langInfo.GetRegionNames(regions);
614 614
   sort(regions.begin(), regions.end(), sortstringbyname());
615 615
 
  616
+  bool match = false;
616 617
   for (unsigned int i = 0; i < regions.size(); ++i)
617  
-    list.push_back(make_pair(regions[i], regions[i]));
  618
+  {
  619
+    CStdString region = regions[i];
  620
+    list.push_back(make_pair(region, region));
  621
+
  622
+    if (!match && region.Equals(((CSettingString*)setting)->GetValue().c_str()))
  623
+    {
  624
+      match = true;
  625
+      current = region;
  626
+    }
  627
+  }
  628
+
  629
+  if (!match && regions.size() > 0)
  630
+    current = regions[0];
618 631
 }
619 632
 
620 633
 void CLangInfo::SettingOptionsLanguagesFillerGeneral(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current,

0 notes on commit a391051

Please sign in to comment.
Something went wrong with that request. Please try again.