Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
Arne Morten Kvarving authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 xbmc/utils/LangCodeExpander.cpp
View
15 xbmc/utils/LangCodeExpander.cpp
@@ -271,6 +271,9 @@ bool CLangCodeExpander::ConvertWindowsToGeneralCharCode(const CStdString& strWin
bool CLangCodeExpander::ConvertToTwoCharCode(CStdString& code, const CStdString& lang)
{
+ if (lang.empty())
+ return false;
+
if (lang.length() == 2)
{
CStdString tmp;
@@ -326,6 +329,9 @@ bool CLangCodeExpander::ConvertToTwoCharCode(CStdString& code, const CStdString&
bool CLangCodeExpander::ReverseLookup(const CStdString& desc, CStdString& code)
{
+ if (desc.empty())
+ return false;
+
CStdString descTmp(desc);
descTmp.Trim();
STRINGLOOKUPTABLE::iterator it;
@@ -358,6 +364,9 @@ bool CLangCodeExpander::ReverseLookup(const CStdString& desc, CStdString& code)
bool CLangCodeExpander::LookupInMap(CStdString& desc, const CStdString& code)
{
+ if (code.empty())
+ return false;
+
STRINGLOOKUPTABLE::iterator it;
//Make sure we convert to lowercase before trying to find it
CStdString sCode(code);
@@ -375,6 +384,9 @@ bool CLangCodeExpander::LookupInMap(CStdString& desc, const CStdString& code)
bool CLangCodeExpander::LookupInDb(CStdString& desc, const CStdString& code)
{
+ if (code.empty())
+ return false;
+
long longcode;
CStdString sCode(code);
sCode.MakeLower();
@@ -481,6 +493,9 @@ bool CLangCodeExpander::CompareLangCodes(const CStdString& code1, const CStdStri
CStdString CLangCodeExpander::ConvertToISO6392T(const CStdString& lang)
{
+ if (lang.empty())
+ return lang;
+
CStdString two, three;
if (ConvertToTwoCharCode(two, lang))
{

1 comment on commit 1f83206

@FernetMenta
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.