Skip to content
This repository
Browse code

Merge pull request #3248 from ace20022/silence_lce

[LangCodeExpander] Reduce log spamming if input string is empty
  • Loading branch information...
commit 1f83206f6513853cbe261deb1b9a3bf88ff0ba41 2 parents 6510dfa + f334e83
authored

Showing 1 changed file with 15 additions and 0 deletions. Show diff stats Hide diff stats

  1. 15  xbmc/utils/LangCodeExpander.cpp
15  xbmc/utils/LangCodeExpander.cpp
@@ -271,6 +271,9 @@ bool CLangCodeExpander::ConvertWindowsToGeneralCharCode(const CStdString& strWin
271 271
 
272 272
 bool CLangCodeExpander::ConvertToTwoCharCode(CStdString& code, const CStdString& lang)
273 273
 {
  274
+  if (lang.empty())
  275
+    return false;
  276
+
274 277
   if (lang.length() == 2)
275 278
   {
276 279
     CStdString tmp;
@@ -326,6 +329,9 @@ bool CLangCodeExpander::ConvertToTwoCharCode(CStdString& code, const CStdString&
326 329
 
327 330
 bool CLangCodeExpander::ReverseLookup(const CStdString& desc, CStdString& code)
328 331
 {
  332
+  if (desc.empty())
  333
+    return false;
  334
+
329 335
   CStdString descTmp(desc);
330 336
   descTmp.Trim();
331 337
   STRINGLOOKUPTABLE::iterator it;
@@ -358,6 +364,9 @@ bool CLangCodeExpander::ReverseLookup(const CStdString& desc, CStdString& code)
358 364
 
359 365
 bool CLangCodeExpander::LookupInMap(CStdString& desc, const CStdString& code)
360 366
 {
  367
+  if (code.empty())
  368
+    return false;
  369
+
361 370
   STRINGLOOKUPTABLE::iterator it;
362 371
   //Make sure we convert to lowercase before trying to find it
363 372
   CStdString sCode(code);
@@ -375,6 +384,9 @@ bool CLangCodeExpander::LookupInMap(CStdString& desc, const CStdString& code)
375 384
 
376 385
 bool CLangCodeExpander::LookupInDb(CStdString& desc, const CStdString& code)
377 386
 {
  387
+  if (code.empty())
  388
+    return false;
  389
+
378 390
   long longcode;
379 391
   CStdString sCode(code);
380 392
   sCode.MakeLower();
@@ -481,6 +493,9 @@ bool CLangCodeExpander::CompareLangCodes(const CStdString& code1, const CStdStri
481 493
 
482 494
 CStdString CLangCodeExpander::ConvertToISO6392T(const CStdString& lang)
483 495
 {
  496
+  if (lang.empty())
  497
+    return lang;
  498
+
484 499
   CStdString two, three;
485 500
   if (ConvertToTwoCharCode(two, lang))
486 501
   {

1 note on commit 1f83206

Rainer Hochecker
Collaborator

seems to be still some messages left:
unable to load special://xbmc/language/qaa/langinfo.xml: Failed to open file at line 0

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