Permalink
Browse files

Only set text if a template replacement was made.

Fixes #11664
  • Loading branch information...
jyavenard committed Jul 12, 2013
1 parent 172a8e3 commit 98602d94e33537cf683c0640027685e3aae9f5b8
Showing with 6 additions and 1 deletion.
  1. +6 −1 mythtv/libs/libmythui/mythuitext.cpp
@@ -169,6 +169,7 @@ void MythUIText::SetTextFromMap(QHash<QString, QString> &map)
QCoreApplication::UnicodeUTF8);
QString tempString = translatedTemplate;
bool replaced = false;
while ((pos = regexp.indexIn(translatedTemplate, pos)) != -1)
{
@@ -182,12 +183,16 @@ void MythUIText::SetTextFromMap(QHash<QString, QString> &map)
.arg(regexp.cap(3))
.arg(map.value(key))
.arg(regexp.cap(6));
replaced = true;
}
tempString.replace(regexp.cap(0), replacement);
pos += regexp.matchedLength();
}
SetText(tempString);
if (replaced)
{
SetText(tempString);
}
}
else if (map.contains(objectName()))
{

0 comments on commit 98602d9

Please sign in to comment.