Skip to content

Commit

Permalink
[addons] Preserve strings which are not string ids in enum lvalues
Browse files Browse the repository at this point in the history
  • Loading branch information
LS80 committed Jul 3, 2016
1 parent 19efa16 commit 40e4fe6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions xbmc/addons/GUIDialogAddonSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,15 +782,18 @@ void CGUIDialogAddonSettings::CreateControls()
int iAdd = i;
if (entryVec.size() > i)
iAdd = atoi(entryVec[i].c_str());
if (!lvalues.empty())
std::string replace;
if (!lvalues.empty() && std::all_of(valuesVec[i].begin(), valuesVec[i].end(), ::isdigit))
{
std::string replace = g_localizeStrings.GetAddonString(m_addon->ID(),atoi(valuesVec[i].c_str()));
replace = g_localizeStrings.GetAddonString(m_addon->ID(), atoi(valuesVec[i].c_str()));
if (replace.empty())
replace = g_localizeStrings.Get(atoi(valuesVec[i].c_str()));
((CGUISpinControlEx *)pControl)->AddLabel(replace, iAdd);
if (replace.empty())
replace = valuesVec[i];
}
else
((CGUISpinControlEx *)pControl)->AddLabel(valuesVec[i], iAdd);
replace = valuesVec[i];
((CGUISpinControlEx *)pControl)->AddLabel(replace, iAdd);
}
if (type == "labelenum")
{ // need to run through all our settings and find the one that matches
Expand Down

0 comments on commit 40e4fe6

Please sign in to comment.