avoid expensive fromUtf8 method where not needed

This commit is contained in:
wmayer 2016-09-21 11:42:23 +02:00
parent 1c4052bde9
commit 3f9fd3d54f

View File

@ -1223,7 +1223,7 @@ void LabelEditor::setText(const QString& s)
this->plainText = s;
QStringList list = this->plainText.split(QString::fromLatin1("\n"));
QString text = QString::fromUtf8("[%1]").arg(list.join(QLatin1String(",")));
QString text = QString::fromLatin1("[%1]").arg(list.join(QLatin1String(",")));
lineEdit->setText(text);
}
@ -1247,7 +1247,7 @@ void LabelEditor::changeText()
this->plainText = inputText;
QStringList list = this->plainText.split(QString::fromLatin1("\n"));
QString text = QString::fromUtf8("[%1]").arg(list.join(QLatin1String(",")));
QString text = QString::fromLatin1("[%1]").arg(list.join(QLatin1String(",")));
lineEdit->setText(text);
}
}
@ -1257,8 +1257,8 @@ void LabelEditor::changeText()
*/
void LabelEditor::validateText(const QString& s)
{
if ( s.startsWith(QString::fromUtf8("[")) && s.endsWith(QString::fromUtf8("]")) )
this->plainText = s.mid(1,s.size()-2).replace(QString::fromUtf8(","),QString::fromUtf8("\n"));
if ( s.startsWith(QLatin1String("[")) && s.endsWith(QLatin1String("]")) )
this->plainText = s.mid(1,s.size()-2).replace(QLatin1String(","),QLatin1String("\n"));
}
/**