Commit d9015eaa authored by Daniel Mensinger's avatar Daniel Mensinger

meson: Some minor code cleanup

parent 627e63c8
Pipeline #5253 passed with stage
in 53 minutes and 20 seconds
......@@ -59,7 +59,7 @@ public:
startOutput();
output->appendLine(i18n(" *** MESON ERROR ***\n"));
QStringList lines = m_error.split(QChar::fromLatin1('\n'));
QStringList lines = m_error.split(QLatin1Char('\n'));
output->appendLines(lines);
setError(!m_error.isEmpty());
......
......@@ -59,7 +59,7 @@ MesonJob::MesonJob(Meson::BuildDir const& buildDir, IProject* project, MesonJob:
*this << m_arguments;
for (auto i : buildDir.mesonArgs.split(QChar::fromLatin1(' '))) {
for (auto i : buildDir.mesonArgs.split(QLatin1Char(' '))) {
if (!i.isEmpty()) {
*this << i;
}
......
......@@ -393,7 +393,7 @@ QString MesonManager::extraArguments(KDevelop::ProjectBaseItem* item) const
if (!src) {
return {};
}
return src->extraArgs().join(QChar::fromLatin1(' '));
return src->extraArgs().join(QLatin1Char(' '));
}
bool MesonManager::hasBuildInfo(KDevelop::ProjectBaseItem* item) const
......
......@@ -154,7 +154,7 @@ QString MesonIntrospectJob::importMesonAPI(const BuildDir& buildDir, MesonIntros
{
QString typeStr = getTypeString(type);
QString option = QStringLiteral("--") + typeStr;
option.replace(QChar::fromLatin1('_'), QChar::fromLatin1('-'));
option.replace(QLatin1Char('_'), QLatin1Char('-'));
KProcess proc(this);
proc.setWorkingDirectory(m_projectPath.toLocalFile());
......@@ -164,7 +164,7 @@ QString MesonIntrospectJob::importMesonAPI(const BuildDir& buildDir, MesonIntros
int ret = proc.execute();
if (ret != 0) {
return i18n("%1 returned %2", proc.program().join(QChar::fromLatin1(' ')), ret);
return i18n("%1 returned %2", proc.program().join(QLatin1Char(' ')), ret);
}
QJsonParseError error;
......@@ -179,7 +179,7 @@ QString MesonIntrospectJob::importMesonAPI(const BuildDir& buildDir, MesonIntros
(*out)[typeStr] = doc.object();
} else {
return i18n("The introspection output of '%1' contains neither an array nor an object",
proc.program().join(QChar::fromLatin1(' ')));
proc.program().join(QLatin1Char(' ')));
}
return QString();
......
......@@ -284,7 +284,7 @@ void MesonOptionArray::setFromString(QString const& value)
void MesonOptionBool::setFromString(QString const& value)
{
setValue(value.toLower() == QStringLiteral("true"));
setValue(value.toLower() == QLatin1String("true"));
}
void MesonOptionCombo::setFromString(QString const& value)
......
......@@ -127,7 +127,7 @@ void MesonTargetSources::splitParamerters()
QString name = define;
QString value;
int equalPos = define.indexOf(QChar::fromLatin1('='));
int equalPos = define.indexOf(QLatin1Char('='));
if (equalPos > 0) {
name = define.left(equalPos);
value = define.mid(equalPos + 1);
......
......@@ -50,7 +50,7 @@ QJsonObject MesonKWARGSInfo::command()
res[QStringLiteral("id")] = m_id;
res[QStringLiteral("operation")] = QStringLiteral("info");
m_infoID = func2str(m_func) + QStringLiteral("#") + m_id;
m_infoID = func2str(m_func) + QLatin1Char('#') + m_id;
return res;
}
......
......@@ -69,7 +69,7 @@ QString MesonRewriterJob::execute()
int ret = proc.execute();
if (ret != 0) {
return i18n("%1 returned %2", proc.program().join(QChar::fromLatin1(' ')), ret);
return i18n("%1 returned %2", proc.program().join(QLatin1Char(' ')), ret);
}
auto rawData = proc.readAllStandardError();
......@@ -84,7 +84,7 @@ QString MesonRewriterJob::execute()
}
if (!result.isObject()) {
return i18n("The rewriter output of '%1' is not an object", proc.program().join(QChar::fromLatin1(' ')));
return i18n("The rewriter output of '%1' is not an object", proc.program().join(QLatin1Char(' ')));
}
for (auto& i : m_actions) {
......
......@@ -35,7 +35,7 @@ MesonRewriterInputBase::MesonRewriterInputBase(QString const& name, QString cons
{
m_ui = new Ui::MesonRewriterInputBase;
m_ui->setupUi(this);
m_ui->l_name->setText(m_name + QStringLiteral(":"));
m_ui->l_name->setText(m_name + QLatin1Char(':'));
connect(this, &MesonRewriterInputBase::configChanged, this, &MesonRewriterInputBase::updateUi);
}
......@@ -142,7 +142,7 @@ MesonRewriterInputString::MesonRewriterInputString(QString const& name, QString
: MesonRewriterInputBase(name, kwarg, parent)
{
m_lineEdit = new QLineEdit(this);
connect(m_lineEdit, &QLineEdit::textChanged, this, [=]() { emit configChanged(); });
connect(m_lineEdit, &QLineEdit::textChanged, this, [this]() { emit configChanged(); });
setInputWidget(m_lineEdit);
}
......
......@@ -340,7 +340,7 @@ void MesonRewriterPage::reset()
auto options = m_opts->options();
for (auto i : rawValues) {
int idx = i.indexOf(QChar::fromLatin1('='));
int idx = i.indexOf(QLatin1Char('='));
if (idx < 0) {
continue;
}
......
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