Commit 418ea78c authored by Michael Reeves's avatar Michael Reeves

Don't use temporary with QLatin1String constructor

parent c001fdee
Pipeline #9935 passed with stage
in 9 minutes and 20 seconds
......@@ -1978,7 +1978,9 @@ void EncodingLabel::insertCodec(const QString& visibleCodecName, QTextCodec* pCo
if(pCodec != nullptr && !codecEnumList.contains(CodecMIBEnum))
{
QAction* pAction = new QAction(pMenu); // menu takes ownership, so deleting the menu deletes the action too.
QLatin1String codecName(pCodec->name());
QByteArray nameArray = pCodec->name();
QLatin1String codecName = QLatin1String(nameArray);
pAction->setText(visibleCodecName.isEmpty() ? codecName : visibleCodecName + QLatin1String(" (") + codecName + QLatin1String(")"));
pAction->setData(CodecMIBEnum);
pAction->setCheckable(true);
......
......@@ -410,7 +410,9 @@ class OptionEncodingComboBox : public QComboBox, public OptionCodec
{
if(c != nullptr)
{
QString codecName = QLatin1String(c->name());
QByteArray nameArray = c->name();
QLatin1String codecName = QLatin1String(nameArray);
for(int i = 0; i < m_codecVec.size(); ++i)
{
if(c == m_codecVec[i])
......@@ -420,7 +422,7 @@ class OptionEncodingComboBox : public QComboBox, public OptionCodec
// The m_codecVec.size will at this point return the value we need for the index.
if(codecName == defaultName())
saveDefaultIndex(m_codecVec.size());
QString itemText = visibleCodecName.isEmpty() ? codecName : visibleCodecName + QStringLiteral(" (") + codecName + QStringLiteral(")");
QString itemText = visibleCodecName.isEmpty() ? codecName : visibleCodecName + QLatin1String(" (") + codecName + QLatin1String(")");
addItem(itemText, (int)m_codecVec.size());
m_codecVec.push_back(c);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment