Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
avoid expensive fromUtf8 method where not needed
  • Loading branch information
wwmayer committed Sep 21, 2016
1 parent 1c4052b commit 3f9fd3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Gui/Widgets.cpp
Expand Up @@ -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);
}

Expand All @@ -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);
}
}
Expand All @@ -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"));
}

/**
Expand Down

0 comments on commit 3f9fd3d

Please sign in to comment.