Commit 1854502e authored by Daniel Mensinger's avatar Daniel Mensinger

meson: change const& style and reformat with clang-format

parent 75a73b77
Pipeline #5414 failed with stage
in 60 minutes and 1 second
......@@ -92,7 +92,7 @@ MesonBuilder::MesonBuilder(QObject* parent)
}
}
MesonBuilder::DirectoryStatus MesonBuilder::evaluateBuildDirectory(const Path& path, QString const& backend)
MesonBuilder::DirectoryStatus MesonBuilder::evaluateBuildDirectory(const Path& path, const QString& backend)
{
QString pathSTR = path.toLocalFile();
if (pathSTR.isEmpty()) {
......@@ -122,7 +122,7 @@ MesonBuilder::DirectoryStatus MesonBuilder::evaluateBuildDirectory(const Path& p
// Check if the directory is a meson directory
const static QStringList mesonPaths = { QStringLiteral("meson-logs"), QStringLiteral("meson-private") };
for (auto const& i : mesonPaths) {
for (const auto& i : mesonPaths) {
Path curr = path;
curr.addPath(i);
QFileInfo currFI(curr.toLocalFile());
......@@ -140,7 +140,7 @@ MesonBuilder::DirectoryStatus MesonBuilder::evaluateBuildDirectory(const Path& p
}
// Check if this is a CONFIGURED meson directory
for (auto const& i : configured) {
for (const auto& i : configured) {
Path curr = path;
curr.addPath(i);
QFileInfo currFI(curr.toLocalFile());
......@@ -204,15 +204,15 @@ KJob* MesonBuilder::configure(KDevelop::IProject* project)
{
Q_ASSERT(project);
auto buildDir = Meson::currentBuildDir(project);
if(!buildDir.isValid()) {
auto *bsm = project->buildSystemManager();
MesonManager *manager = dynamic_cast<MesonManager *>(bsm);
if(!manager) {
if (!buildDir.isValid()) {
auto* bsm = project->buildSystemManager();
MesonManager* manager = dynamic_cast<MesonManager*>(bsm);
if (!manager) {
return new ErrorJob(this, i18n("Internal error: The buildsystem manager is not the MesonManager"));
}
KJob *newBDJob = manager->newBuildDirectory(project);
if(!newBDJob) {
KJob* newBDJob = manager->newBuildDirectory(project);
if (!newBDJob) {
return new ErrorJob(this, i18n("Failed to create a new build directory"));
}
return newBDJob;
......@@ -230,19 +230,19 @@ KJob* MesonBuilder::configureIfRequired(KDevelop::IProject* project, KJob* realJ
return realJob;
}
KJob *configureJob = nullptr;
if(buildDir.isValid()) {
KJob* configureJob = nullptr;
if (buildDir.isValid()) {
configureJob = configure(project, buildDir, {}, status);
} else {
// Create a new build directory
auto *bsm = project->buildSystemManager();
MesonManager *manager = dynamic_cast<MesonManager *>(bsm);
if(!manager) {
auto* bsm = project->buildSystemManager();
MesonManager* manager = dynamic_cast<MesonManager*>(bsm);
if (!manager) {
return new ErrorJob(this, i18n("Internal error: The buildsystem manager is not the MesonManager"));
}
configureJob = manager->newBuildDirectory(project);
if(!configureJob) {
if (!configureJob) {
return new ErrorJob(this, i18n("Failed to create a new build directory"));
}
}
......
......@@ -52,16 +52,16 @@ public:
KJob* prune(KDevelop::IProject* project) override;
KJob* configure(KDevelop::IProject* project) override;
KJob* configure(KDevelop::IProject* project, Meson::BuildDir const& buildDir, QStringList args,
KJob* configure(KDevelop::IProject* project, const Meson::BuildDir& buildDir, QStringList args,
DirectoryStatus status = ___UNDEFINED___);
/// Evaluate a directory for the use with meson
static DirectoryStatus evaluateBuildDirectory(KDevelop::Path const& path, QString const& backend);
static DirectoryStatus evaluateBuildDirectory(const KDevelop::Path& path, const QString& backend);
bool hasError() const;
QString errorDescription() const;
QList<KDevelop::IProjectBuilder *> additionalBuilderPlugins(KDevelop::IProject * project) const override;
QList<KDevelop::IProjectBuilder*> additionalBuilderPlugins(KDevelop::IProject* project) const override;
Q_SIGNALS:
void built(KDevelop::ProjectBaseItem*);
......@@ -75,5 +75,5 @@ private:
KDevelop::IProjectBuilder* m_ninjaBuilder = nullptr;
QString m_errorString;
KJob* configureIfRequired(KDevelop::IProject* project, KJob *realJob);
KJob* configureIfRequired(KDevelop::IProject* project, KJob* realJob);
};
......@@ -145,7 +145,7 @@ void Meson::writeMesonConfig(IProject* project, const MesonConfig& cfg)
root.writeEntry(CURRENT_INDEX, currentIndex);
int counter = 0;
for (auto const& i : cfg.buildDirs) {
for (const auto& i : cfg.buildDirs) {
KConfigGroup current = root.group(BUILD_DIR_SEC.arg(counter++));
current.writeEntry(BUILD_DIR_PATH, i.buildDir.path());
......
......@@ -42,8 +42,7 @@ struct BuildDir {
void canonicalizePaths();
};
struct MesonConfig
{
struct MesonConfig {
int currentIndex = -1;
QVector<BuildDir> buildDirs;
......@@ -54,6 +53,6 @@ struct MesonConfig
KConfigGroup rootGroup(KDevelop::IProject* project);
BuildDir currentBuildDir(KDevelop::IProject* project);
MesonConfig getMesonConfig(KDevelop::IProject* project);
void writeMesonConfig(KDevelop::IProject* project, MesonConfig const& cfg);
void writeMesonConfig(KDevelop::IProject* project, const MesonConfig& cfg);
}
......@@ -28,7 +28,7 @@
using namespace KDevelop;
MesonJob::MesonJob(Meson::BuildDir const& buildDir, IProject* project, MesonJob::CommandType commandType,
MesonJob::MesonJob(const Meson::BuildDir& buildDir, IProject* project, MesonJob::CommandType commandType,
const QStringList& arguments, QObject* parent)
: OutputExecuteJob(parent)
, m_project(project)
......
......@@ -38,8 +38,8 @@ public:
enum CommandType { CONFIGURE, RE_CONFIGURE, SET_CONFIG };
public:
MesonJob(Meson::BuildDir const& buildDir, KDevelop::IProject* project, CommandType commandType,
QStringList const& arguments, QObject* parent);
MesonJob(const Meson::BuildDir& buildDir, KDevelop::IProject* project, CommandType commandType,
const QStringList& arguments, QObject* parent);
QUrl workingDirectory() const override;
......
......@@ -31,7 +31,7 @@
using namespace KDevelop;
MesonJobPrune::MesonJobPrune(Meson::BuildDir const& buildDir, QObject* parent)
MesonJobPrune::MesonJobPrune(const Meson::BuildDir& buildDir, QObject* parent)
: OutputJob(parent, Verbose)
, m_buildDir(buildDir.buildDir)
, m_backend(buildDir.mesonBackend)
......
......@@ -32,7 +32,7 @@ class MesonJobPrune : public KDevelop::OutputJob
{
Q_OBJECT
public:
explicit MesonJobPrune(Meson::BuildDir const& buildDir, QObject* parent);
explicit MesonJobPrune(const Meson::BuildDir& buildDir, QObject* parent);
void start() override;
bool doKill() override;
......
......@@ -59,7 +59,8 @@ K_PLUGIN_FACTORY_WITH_JSON(MesonSupportFactory, "kdevmesonmanager.json", registe
// * Error job for failed imports *
// ********************************
namespace mmanager_internal {
namespace mmanager_internal
{
class ErrorJob : public KJob
{
......@@ -307,7 +308,7 @@ KJob* MesonManager::createImportJob(ProjectFolderItem* item)
auto tgtList = targets->targets();
QVector<MesonTarget*> tgtCopy;
tgtCopy.reserve(tgtList.size());
transform(begin(tgtList), end(tgtList), back_inserter(tgtCopy), [](auto const& a) { return a.get(); });
transform(begin(tgtList), end(tgtList), back_inserter(tgtCopy), [](const auto& a) { return a.get(); });
populateTargets(item, tgtCopy);
......@@ -457,7 +458,7 @@ Path MesonManager::findMeson() const
const static QStringList mesonPaths
= { QStringLiteral("%1/.local/bin").arg(QStandardPaths::standardLocations(QStandardPaths::HomeLocation)[0]) };
for (auto const& i : mesonExecutables) {
for (const auto& i : mesonExecutables) {
mesonPath = QStandardPaths::findExecutable(i);
if (!mesonPath.isEmpty()) {
break;
......
......@@ -56,7 +56,7 @@ public:
* Create a new build directory and write it into the config.
* @returns The configuration job on success or nullptr on error.
*/
KJob* newBuildDirectory(KDevelop::IProject* project, Meson::BuildDir *outBuildDir = nullptr);
KJob* newBuildDirectory(KDevelop::IProject* project, Meson::BuildDir* outBuildDir = nullptr);
/// Returns a list of all supported Meson backends (for now only ninja)
QStringList supportedMesonBackends() const;
......
......@@ -61,8 +61,8 @@ public:
MesonTestSuitesPtr tests();
private:
QString importJSONFile(Meson::BuildDir const& buildDir, Type type, QJsonObject* out);
QString importMesonAPI(Meson::BuildDir const& buildDir, Type type, QJsonObject* out);
QString importJSONFile(const Meson::BuildDir& buildDir, Type type, QJsonObject* out);
QString importMesonAPI(const Meson::BuildDir& buildDir, Type type, QJsonObject* out);
QString import(Meson::BuildDir buildDir);
void finished();
......
......@@ -48,21 +48,21 @@ static const QHash<QString, MesonOptionBase::Type> STRING2TYPE = {
{ QStringLiteral("string"), MesonOptionBase::STRING },
};
MesonOptions::MesonOptions(QJsonArray const& arr)
MesonOptions::MesonOptions(const QJsonArray& arr)
{
fromJSON(arr);
}
// Option constructors
MesonOptionBase::MesonOptionBase(QString const& name, QString const& description, MesonOptionBase::Section section)
MesonOptionBase::MesonOptionBase(const QString& name, const QString& description, MesonOptionBase::Section section)
: m_name(name)
, m_description(description)
, m_section(section)
{
}
MesonOptionArray::MesonOptionArray(QString const& name, QString const& description, MesonOptionBase::Section section,
MesonOptionArray::MesonOptionArray(const QString& name, const QString& description, MesonOptionBase::Section section,
QStringList value)
: MesonOptionBase(name, description, section)
, m_value(value)
......@@ -70,15 +70,16 @@ MesonOptionArray::MesonOptionArray(QString const& name, QString const& descripti
{
}
MesonOptionBool::MesonOptionBool(QString const& name, QString const& description, MesonOptionBase::Section section, bool value)
MesonOptionBool::MesonOptionBool(const QString& name, const QString& description, MesonOptionBase::Section section,
bool value)
: MesonOptionBase(name, description, section)
, m_value(value)
, m_initialValue(value)
{
}
MesonOptionCombo::MesonOptionCombo(QString const& name, QString const& description, MesonOptionBase::Section section, QString value,
QStringList choices)
MesonOptionCombo::MesonOptionCombo(const QString& name, const QString& description, MesonOptionBase::Section section,
QString value, QStringList choices)
: MesonOptionBase(name, description, section)
, m_value(value)
, m_initialValue(value)
......@@ -86,14 +87,16 @@ MesonOptionCombo::MesonOptionCombo(QString const& name, QString const& descripti
{
}
MesonOptionInteger::MesonOptionInteger(QString const& name, QString const& description, MesonOptionBase::Section section, int value)
MesonOptionInteger::MesonOptionInteger(const QString& name, const QString& description,
MesonOptionBase::Section section, int value)
: MesonOptionBase(name, description, section)
, m_value(value)
, m_initialValue(value)
{
}
MesonOptionString::MesonOptionString(QString const& name, QString const& description, MesonOptionBase::Section section, QString value)
MesonOptionString::MesonOptionString(const QString& name, const QString& description, MesonOptionBase::Section section,
QString value)
: MesonOptionBase(name, description, section)
, m_value(value)
, m_initialValue(value)
......@@ -139,7 +142,7 @@ QString MesonOptionArray::value() const
QStringList tmp;
tmp.reserve(m_value.size());
transform(begin(m_value), end(m_value), back_inserter(tmp),
[](QString const& str) -> QString { return QStringLiteral("'") + str + QStringLiteral("'"); });
[](const QString& str) -> QString { return QStringLiteral("'") + str + QStringLiteral("'"); });
return QStringLiteral("[") + tmp.join(QStringLiteral(", ")) + QStringLiteral("]");
}
......@@ -170,7 +173,7 @@ QString MesonOptionArray::initialValue() const
QStringList tmp;
tmp.reserve(m_initialValue.size());
transform(begin(m_initialValue), end(m_initialValue), back_inserter(tmp),
[](QString const& str) -> QString { return QStringLiteral("'") + str + QStringLiteral("'"); });
[](const QString& str) -> QString { return QStringLiteral("'") + str + QStringLiteral("'"); });
return QStringLiteral("[") + tmp.join(QStringLiteral(", ")) + QStringLiteral("]");
}
......@@ -250,7 +253,7 @@ QString MesonOptionString::rawValue() const
// Set value functions
void MesonOptionArray::setValue(QStringList const& val)
void MesonOptionArray::setValue(const QStringList& val)
{
m_value = val;
}
......@@ -260,7 +263,7 @@ void MesonOptionBool::setValue(bool val)
m_value = val;
}
void MesonOptionCombo::setValue(QString const& val)
void MesonOptionCombo::setValue(const QString& val)
{
m_value = val;
}
......@@ -270,34 +273,34 @@ void MesonOptionInteger::setValue(int val)
m_value = val;
}
void MesonOptionString::setValue(QString const& val)
void MesonOptionString::setValue(const QString& val)
{
m_value = val;
}
// Set value from string
void MesonOptionArray::setFromString(QString const& value)
void MesonOptionArray::setFromString(const QString& value)
{
setValue({ value });
}
void MesonOptionBool::setFromString(QString const& value)
void MesonOptionBool::setFromString(const QString& value)
{
setValue(value.toLower() == QLatin1String("true"));
}
void MesonOptionCombo::setFromString(QString const& value)
void MesonOptionCombo::setFromString(const QString& value)
{
setValue(value);
}
void MesonOptionInteger::setFromString(QString const& value)
void MesonOptionInteger::setFromString(const QString& value)
{
setValue(value.toInt());
}
void MesonOptionString::setFromString(QString const& value)
void MesonOptionString::setFromString(const QString& value)
{
setValue(value);
}
......@@ -340,7 +343,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj)
auto valueJV = obj[QStringLiteral("value")];
// Check all values
for (auto const& i : { nameJV, descriptionJV, sectionJV, typeJV }) {
for (const auto& i : { nameJV, descriptionJV, sectionJV, typeJV }) {
if (!i.isString()) {
qCWarning(KDEV_Meson) << "OPT: Base type validation failed" << typeJV.toString();
return nullptr;
......@@ -377,7 +380,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj)
QJsonArray raw = valueJV.toArray();
QStringList values;
values.reserve(raw.size());
transform(begin(raw), end(raw), back_inserter(values), [](QJsonValue const& v) { return v.toString(); });
transform(begin(raw), end(raw), back_inserter(values), [](const QJsonValue& v) { return v.toString(); });
return make_shared<MesonOptionArray>(name, description, section, values);
}
......@@ -396,7 +399,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj)
QJsonArray raw = choicesJV.toArray();
QStringList choices;
choices.reserve(raw.size());
transform(begin(raw), end(raw), back_inserter(choices), [](QJsonValue const& v) { return v.toString(); });
transform(begin(raw), end(raw), back_inserter(choices), [](const QJsonValue& v) { return v.toString(); });
return make_shared<MesonOptionCombo>(name, description, section, valueJV.toString(), choices);
}
......@@ -446,7 +449,7 @@ void MesonOptions::fromJSON(const QJsonArray& arr)
m_options.clear();
m_options.reserve(arr.size());
for (QJsonValue const& i : arr) {
for (const QJsonValue& i : arr) {
if (!i.isObject()) {
continue;
}
......@@ -462,7 +465,7 @@ void MesonOptions::fromJSON(const QJsonArray& arr)
void MesonOptions::print() const
{
for (auto const& i : m_options) {
for (const auto& i : m_options) {
qCDebug(KDEV_Meson) << i->name() << " = " << i->value() << " [" << i->type() << "] -- " << i->section();
}
}
......
......@@ -43,13 +43,13 @@ public:
enum Type { ARRAY, BOOLEAN, COMBO, INTEGER, STRING };
public:
explicit MesonOptionBase(QString const& name, QString const& description, Section section);
explicit MesonOptionBase(const QString& name, const QString& description, Section section);
virtual ~MesonOptionBase();
virtual Type type() const = 0;
virtual QString value() const = 0;
virtual QString initialValue() const = 0;
virtual void setFromString(QString const& value) = 0;
virtual void setFromString(const QString& value) = 0;
virtual void reset() = 0;
QString name() const;
......@@ -59,7 +59,7 @@ public:
QString mesonArg() const;
bool isUpdated() const;
static MesonOptionPtr fromJSON(QJsonObject const& obj);
static MesonOptionPtr fromJSON(const QJsonObject& obj);
private:
QString m_name;
......@@ -70,16 +70,16 @@ private:
class MesonOptionArray : public MesonOptionBase
{
public:
MesonOptionArray(QString const& name, QString const& description, Section section, QStringList value);
MesonOptionArray(const QString& name, const QString& description, Section section, QStringList value);
MesonOptionBase::Type type() const override;
QString value() const override;
QString initialValue() const override;
void setFromString(QString const& value) override;
void setFromString(const QString& value) override;
void reset() override;
QStringList rawValue() const;
void setValue(QStringList const& val);
void setValue(const QStringList& val);
private:
QStringList m_value;
......@@ -89,12 +89,12 @@ private:
class MesonOptionBool : public MesonOptionBase
{
public:
MesonOptionBool(QString const& name, QString const& description, Section section, bool value);
MesonOptionBool(const QString& name, const QString& description, Section section, bool value);
MesonOptionBase::Type type() const override;
QString value() const override;
QString initialValue() const override;
void setFromString(QString const& value) override;
void setFromString(const QString& value) override;
void reset() override;
bool rawValue() const;
......@@ -108,17 +108,17 @@ private:
class MesonOptionCombo : public MesonOptionBase
{
public:
MesonOptionCombo(QString const& name, QString const& description, Section section, QString value,
MesonOptionCombo(const QString& name, const QString& description, Section section, QString value,
QStringList choices);
MesonOptionBase::Type type() const override;
QString value() const override;
QString initialValue() const override;
void setFromString(QString const& value) override;
void setFromString(const QString& value) override;
void reset() override;
QString rawValue() const;
void setValue(QString const& val);
void setValue(const QString& val);
QStringList choices() const;
private:
......@@ -130,12 +130,12 @@ private:
class MesonOptionInteger : public MesonOptionBase
{
public:
MesonOptionInteger(QString const& name, QString const& description, Section section, int value);
MesonOptionInteger(const QString& name, const QString& description, Section section, int value);
MesonOptionBase::Type type() const override;
QString value() const override;
QString initialValue() const override;
void setFromString(QString const& value) override;
void setFromString(const QString& value) override;
void reset() override;
int rawValue() const;
......@@ -149,16 +149,16 @@ private:
class MesonOptionString : public MesonOptionBase
{
public:
MesonOptionString(QString const& name, QString const& description, Section section, QString value);
MesonOptionString(const QString& name, const QString& description, Section section, QString value);
MesonOptionBase::Type type() const override;
QString value() const override;
QString initialValue() const override;
void setFromString(QString const& value) override;
void setFromString(const QString& value) override;
void reset() override;
QString rawValue() const;
void setValue(QString const& val);
void setValue(const QString& val);
private:
QString m_value;
......@@ -171,7 +171,7 @@ private:
class MesonOptions
{
public:
explicit MesonOptions(QJsonArray const& arr);
explicit MesonOptions(const QJsonArray& arr);
int numChanged() const;
QStringList getMesonArgs() const;
......@@ -182,5 +182,5 @@ public:
private:
QVector<MesonOptionPtr> m_options;
void fromJSON(QJsonArray const& arr);
void fromJSON(const QJsonArray& arr);
};
......@@ -30,10 +30,10 @@ using MesonProjectInfoPtr = std::shared_ptr<MesonProjectInfo>;
class MesonProjectInfo
{
public:
explicit MesonProjectInfo(QJsonObject const& json);
explicit MesonProjectInfo(const QJsonObject& json);
virtual ~MesonProjectInfo();
void fromJSON(QJsonObject const& json);
void fromJSON(const QJsonObject& json);
QString name() const;
QString version() const;
......
......@@ -98,11 +98,11 @@ void MesonTargetSources::fromJSON(const QJsonObject& json)
QJsonArray src = json[QStringLiteral("sources")].toArray();
QJsonArray gensrc = json[QStringLiteral("generated_sources")].toArray();
transform(begin(comp), end(comp), back_inserter(m_compiler), [](auto const& x) { return x.toString(); });
transform(begin(param), end(param), back_inserter(m_paramerters), [](auto const& x) { return x.toString(); });
transform(begin(src), end(src), back_inserter(m_sources), [](auto const& x) { return Path(x.toString()); });
transform(begin(comp), end(comp), back_inserter(m_compiler), [](const auto& x) { return x.toString(); });
transform(begin(param), end(param), back_inserter(m_paramerters), [](const auto& x) { return x.toString(); });
transform(begin(src), end(src), back_inserter(m_sources), [](const auto& x) { return Path(x.toString()); });
transform(begin(gensrc), end(gensrc), back_inserter(m_generatedSources),
[](auto const& x) { return Path(x.toString()); });
[](const auto& x) { return Path(x.toString()); });
splitParamerters();
qCDebug(KDEV_Meson) << " - language:" << m_language << "has" << m_sources.count() + m_generatedSources.count()
......@@ -112,7 +112,7 @@ void MesonTargetSources::fromJSON(const QJsonObject& json)
void MesonTargetSources::splitParamerters()
{
for (QString const& i : m_paramerters) {
for (const QString& i : m_paramerters) {
[&]() {
for (auto j : { QStringLiteral("-I"), QStringLiteral("/I"), QStringLiteral("-isystem") }) {
if (i.startsWith(j)) {
......@@ -196,11 +196,11 @@ void MesonTarget::fromJSON(const QJsonObject& json)
m_installed = json[QStringLiteral("installed")].toBool();
QJsonArray files = json[QStringLiteral("filename")].toArray();
transform(begin(files), end(files), back_inserter(m_filename), [](auto const& x) { return Path(x.toString()); });
transform(begin(files), end(files), back_inserter(m_filename), [](const auto& x) { return Path(x.toString()); });
qCDebug(KDEV_Meson) << " - " << m_type << m_name;
for (auto const& i : json[QStringLiteral("target_sources")].toArray()) {
for (const auto& i : json[QStringLiteral("target_sources")].toArray()) {
m_targetSources << make_shared<MesonTargetSources>(i.toObject(), this);
}
}
......@@ -237,7 +237,7 @@ MesonSourcePtr MesonTargets::operator[](KDevelop::Path p)
void MesonTargets::fromJSON(const QJsonArray& json)
{
qCDebug(KDEV_Meson) << "MINTRO: Loading targets from json...";
for (auto const& i : json) {
for (const auto& i : json) {
m_targets << make_shared<MesonTarget>(i.toObject());
}
......
......@@ -39,7 +39,7 @@ using MesonTargetsPtr = std::shared_ptr<MesonTargets>;
class MesonTargetSources
{
public:
explicit MesonTargetSources(QJsonObject const& json, MesonTarget* target);
explicit MesonTargetSources(const QJsonObject& json, MesonTarget* target);
virtual ~MesonTargetSources();
QString language() const;
......@@ -55,7 +55,7 @@ public:
MesonTarget* target();
void fromJSON(QJsonObject const& json);
void fromJSON(const QJsonObject& json);
private:
QString m_language;
......@@ -76,7 +76,7 @@ private:
class MesonTarget
{
public:
explicit MesonTarget(QJsonObject const& json);
explicit MesonTarget(const QJsonObject& json);
virtual ~MesonTarget();
QString name() const;
......@@ -88,7 +88,7 @@ public:
QVector<MesonSourcePtr> targetSources();
void fromJSON(QJsonObject const& json);
void fromJSON(const QJsonObject& json);
private:
QString m_name;
......@@ -104,7 +104,7 @@ private:
class MesonTargets
{
public:
explicit MesonTargets(QJsonArray const& json);
explicit MesonTargets(const QJsonArray& json);
virtual ~MesonTargets();
QVector<MesonTargetPtr> targets();
......@@ -112,7 +112,7 @@ public:
MesonSourcePtr fileSource(KDevelop::Path p);
MesonSourcePtr operator[](KDevelop::Path p);
void fromJSON(QJsonArray const& json);
void fromJSON(const QJsonArray& json);
private:
QVector<MesonTargetPtr> m_targets;
......
......@@ -32,7 +32,7 @@ using namespace KDevelop;
// Class MesonTest
MesonTest::MesonTest(QJsonObject const& json, IProject* project)
MesonTest::MesonTest(const QJsonObject& json, IProject* project)
: m_project(project)
{
fromJson(json);
......@@ -88,8 +88,8 @@ void MesonTest::fromJson(const QJsonObject& json)
QJsonArray suites = json[QStringLiteral("suite")].toArray();
QJsonObject env = json[QStringLiteral("env")].toObject();
transform(begin(cmd), end(cmd), back_inserter(m_command), [](auto const& x) { return x.toString(); });
transform(begin(suites), end(suites), back_inserter(m_suites), [](auto const& x) { return x.toString(); });
transform(begin(cmd), end(cmd), back_inserter(m_command), [](const auto& x) { return x.toString(); });
transform(begin(suites), end(suites), back_inserter(m_suites), [](const auto& x) { return x.toString(); });
for (auto i = begin(env); i != end(env); ++i) {
m_env[i.key()] = i.value().toString();
......@@ -141,7 +141,7 @@ KJob* MesonTestSuite::launchCase(const QString& testCase, TestJobVerbosity verbo
KJob* MesonTestSuite::launchCases(const QStringList& testCases, TestJobVerbosity verbosity)
{
QList<KJob*> jobs;
for (auto const& i : testCases) {
for (const auto& i : testCases) {
auto iter = m_tests.find(i);
if (iter == end(m_tests)) {
continue;
......@@ -221,7 +221,7 @@ void MesonTestSuites::fromJSON(const QJsonArray& json)
{
QVector<MesonTestPtr> tests;
qCDebug(KDEV_Meson) << "MINTRO: -- Loading tests from JSON...";
for (auto const& i : json) {
for (const auto& i : json) {
tests << make_shared<MesonTest>(i.toObject(), m_project);
}
......
......@@ -40,7 +40,7 @@ using MesonTestSuitesPtr = std::shared_ptr<MesonTestSuites>;
class MesonTest
{