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) ...@@ -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(); QString pathSTR = path.toLocalFile();
if (pathSTR.isEmpty()) { if (pathSTR.isEmpty()) {
...@@ -122,7 +122,7 @@ MesonBuilder::DirectoryStatus MesonBuilder::evaluateBuildDirectory(const Path& p ...@@ -122,7 +122,7 @@ MesonBuilder::DirectoryStatus MesonBuilder::evaluateBuildDirectory(const Path& p
// Check if the directory is a meson directory // Check if the directory is a meson directory
const static QStringList mesonPaths = { QStringLiteral("meson-logs"), QStringLiteral("meson-private") }; const static QStringList mesonPaths = { QStringLiteral("meson-logs"), QStringLiteral("meson-private") };
for (auto const& i : mesonPaths) { for (const auto& i : mesonPaths) {
Path curr = path; Path curr = path;
curr.addPath(i); curr.addPath(i);
QFileInfo currFI(curr.toLocalFile()); QFileInfo currFI(curr.toLocalFile());
...@@ -140,7 +140,7 @@ MesonBuilder::DirectoryStatus MesonBuilder::evaluateBuildDirectory(const Path& p ...@@ -140,7 +140,7 @@ MesonBuilder::DirectoryStatus MesonBuilder::evaluateBuildDirectory(const Path& p
} }
// Check if this is a CONFIGURED meson directory // Check if this is a CONFIGURED meson directory
for (auto const& i : configured) { for (const auto& i : configured) {
Path curr = path; Path curr = path;
curr.addPath(i); curr.addPath(i);
QFileInfo currFI(curr.toLocalFile()); QFileInfo currFI(curr.toLocalFile());
...@@ -204,15 +204,15 @@ KJob* MesonBuilder::configure(KDevelop::IProject* project) ...@@ -204,15 +204,15 @@ KJob* MesonBuilder::configure(KDevelop::IProject* project)
{ {
Q_ASSERT(project); Q_ASSERT(project);
auto buildDir = Meson::currentBuildDir(project); auto buildDir = Meson::currentBuildDir(project);
if(!buildDir.isValid()) { if (!buildDir.isValid()) {
auto *bsm = project->buildSystemManager(); auto* bsm = project->buildSystemManager();
MesonManager *manager = dynamic_cast<MesonManager *>(bsm); MesonManager* manager = dynamic_cast<MesonManager*>(bsm);
if(!manager) { if (!manager) {
return new ErrorJob(this, i18n("Internal error: The buildsystem manager is not the MesonManager")); return new ErrorJob(this, i18n("Internal error: The buildsystem manager is not the MesonManager"));
} }
KJob *newBDJob = manager->newBuildDirectory(project); KJob* newBDJob = manager->newBuildDirectory(project);
if(!newBDJob) { if (!newBDJob) {
return new ErrorJob(this, i18n("Failed to create a new build directory")); return new ErrorJob(this, i18n("Failed to create a new build directory"));
} }
return newBDJob; return newBDJob;
...@@ -230,19 +230,19 @@ KJob* MesonBuilder::configureIfRequired(KDevelop::IProject* project, KJob* realJ ...@@ -230,19 +230,19 @@ KJob* MesonBuilder::configureIfRequired(KDevelop::IProject* project, KJob* realJ
return realJob; return realJob;
} }
KJob *configureJob = nullptr; KJob* configureJob = nullptr;
if(buildDir.isValid()) { if (buildDir.isValid()) {
configureJob = configure(project, buildDir, {}, status); configureJob = configure(project, buildDir, {}, status);
} else { } else {
// Create a new build directory // Create a new build directory
auto *bsm = project->buildSystemManager(); auto* bsm = project->buildSystemManager();
MesonManager *manager = dynamic_cast<MesonManager *>(bsm); MesonManager* manager = dynamic_cast<MesonManager*>(bsm);
if(!manager) { if (!manager) {
return new ErrorJob(this, i18n("Internal error: The buildsystem manager is not the MesonManager")); return new ErrorJob(this, i18n("Internal error: The buildsystem manager is not the MesonManager"));
} }
configureJob = manager->newBuildDirectory(project); configureJob = manager->newBuildDirectory(project);
if(!configureJob) { if (!configureJob) {
return new ErrorJob(this, i18n("Failed to create a new build directory")); return new ErrorJob(this, i18n("Failed to create a new build directory"));
} }
} }
......
...@@ -52,16 +52,16 @@ public: ...@@ -52,16 +52,16 @@ public:
KJob* prune(KDevelop::IProject* project) override; KJob* prune(KDevelop::IProject* project) override;
KJob* configure(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___); DirectoryStatus status = ___UNDEFINED___);
/// Evaluate a directory for the use with meson /// 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; bool hasError() const;
QString errorDescription() const; QString errorDescription() const;
QList<KDevelop::IProjectBuilder *> additionalBuilderPlugins(KDevelop::IProject * project) const override; QList<KDevelop::IProjectBuilder*> additionalBuilderPlugins(KDevelop::IProject* project) const override;
Q_SIGNALS: Q_SIGNALS:
void built(KDevelop::ProjectBaseItem*); void built(KDevelop::ProjectBaseItem*);
...@@ -75,5 +75,5 @@ private: ...@@ -75,5 +75,5 @@ private:
KDevelop::IProjectBuilder* m_ninjaBuilder = nullptr; KDevelop::IProjectBuilder* m_ninjaBuilder = nullptr;
QString m_errorString; 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) ...@@ -145,7 +145,7 @@ void Meson::writeMesonConfig(IProject* project, const MesonConfig& cfg)
root.writeEntry(CURRENT_INDEX, currentIndex); root.writeEntry(CURRENT_INDEX, currentIndex);
int counter = 0; int counter = 0;
for (auto const& i : cfg.buildDirs) { for (const auto& i : cfg.buildDirs) {
KConfigGroup current = root.group(BUILD_DIR_SEC.arg(counter++)); KConfigGroup current = root.group(BUILD_DIR_SEC.arg(counter++));
current.writeEntry(BUILD_DIR_PATH, i.buildDir.path()); current.writeEntry(BUILD_DIR_PATH, i.buildDir.path());
......
...@@ -42,8 +42,7 @@ struct BuildDir { ...@@ -42,8 +42,7 @@ struct BuildDir {
void canonicalizePaths(); void canonicalizePaths();
}; };
struct MesonConfig struct MesonConfig {
{
int currentIndex = -1; int currentIndex = -1;
QVector<BuildDir> buildDirs; QVector<BuildDir> buildDirs;
...@@ -54,6 +53,6 @@ struct MesonConfig ...@@ -54,6 +53,6 @@ struct MesonConfig
KConfigGroup rootGroup(KDevelop::IProject* project); KConfigGroup rootGroup(KDevelop::IProject* project);
BuildDir currentBuildDir(KDevelop::IProject* project); BuildDir currentBuildDir(KDevelop::IProject* project);
MesonConfig getMesonConfig(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 @@ ...@@ -28,7 +28,7 @@
using namespace KDevelop; 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) const QStringList& arguments, QObject* parent)
: OutputExecuteJob(parent) : OutputExecuteJob(parent)
, m_project(project) , m_project(project)
......
...@@ -38,8 +38,8 @@ public: ...@@ -38,8 +38,8 @@ public:
enum CommandType { CONFIGURE, RE_CONFIGURE, SET_CONFIG }; enum CommandType { CONFIGURE, RE_CONFIGURE, SET_CONFIG };
public: public:
MesonJob(Meson::BuildDir const& buildDir, KDevelop::IProject* project, CommandType commandType, MesonJob(const Meson::BuildDir& buildDir, KDevelop::IProject* project, CommandType commandType,
QStringList const& arguments, QObject* parent); const QStringList& arguments, QObject* parent);
QUrl workingDirectory() const override; QUrl workingDirectory() const override;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
using namespace KDevelop; using namespace KDevelop;
MesonJobPrune::MesonJobPrune(Meson::BuildDir const& buildDir, QObject* parent) MesonJobPrune::MesonJobPrune(const Meson::BuildDir& buildDir, QObject* parent)
: OutputJob(parent, Verbose) : OutputJob(parent, Verbose)
, m_buildDir(buildDir.buildDir) , m_buildDir(buildDir.buildDir)
, m_backend(buildDir.mesonBackend) , m_backend(buildDir.mesonBackend)
......
...@@ -32,7 +32,7 @@ class MesonJobPrune : public KDevelop::OutputJob ...@@ -32,7 +32,7 @@ class MesonJobPrune : public KDevelop::OutputJob
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit MesonJobPrune(Meson::BuildDir const& buildDir, QObject* parent); explicit MesonJobPrune(const Meson::BuildDir& buildDir, QObject* parent);
void start() override; void start() override;
bool doKill() override; bool doKill() override;
......
...@@ -59,7 +59,8 @@ K_PLUGIN_FACTORY_WITH_JSON(MesonSupportFactory, "kdevmesonmanager.json", registe ...@@ -59,7 +59,8 @@ K_PLUGIN_FACTORY_WITH_JSON(MesonSupportFactory, "kdevmesonmanager.json", registe
// * Error job for failed imports * // * Error job for failed imports *
// ******************************** // ********************************
namespace mmanager_internal { namespace mmanager_internal
{
class ErrorJob : public KJob class ErrorJob : public KJob
{ {
...@@ -307,7 +308,7 @@ KJob* MesonManager::createImportJob(ProjectFolderItem* item) ...@@ -307,7 +308,7 @@ KJob* MesonManager::createImportJob(ProjectFolderItem* item)
auto tgtList = targets->targets(); auto tgtList = targets->targets();
QVector<MesonTarget*> tgtCopy; QVector<MesonTarget*> tgtCopy;
tgtCopy.reserve(tgtList.size()); 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); populateTargets(item, tgtCopy);
...@@ -457,7 +458,7 @@ Path MesonManager::findMeson() const ...@@ -457,7 +458,7 @@ Path MesonManager::findMeson() const
const static QStringList mesonPaths const static QStringList mesonPaths
= { QStringLiteral("%1/.local/bin").arg(QStandardPaths::standardLocations(QStandardPaths::HomeLocation)[0]) }; = { QStringLiteral("%1/.local/bin").arg(QStandardPaths::standardLocations(QStandardPaths::HomeLocation)[0]) };
for (auto const& i : mesonExecutables) { for (const auto& i : mesonExecutables) {
mesonPath = QStandardPaths::findExecutable(i); mesonPath = QStandardPaths::findExecutable(i);
if (!mesonPath.isEmpty()) { if (!mesonPath.isEmpty()) {
break; break;
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
* Create a new build directory and write it into the config. * Create a new build directory and write it into the config.
* @returns The configuration job on success or nullptr on error. * @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) /// Returns a list of all supported Meson backends (for now only ninja)
QStringList supportedMesonBackends() const; QStringList supportedMesonBackends() const;
......
...@@ -61,8 +61,8 @@ public: ...@@ -61,8 +61,8 @@ public:
MesonTestSuitesPtr tests(); MesonTestSuitesPtr tests();
private: private:
QString importJSONFile(Meson::BuildDir const& buildDir, Type type, QJsonObject* out); QString importJSONFile(const Meson::BuildDir& buildDir, Type type, QJsonObject* out);
QString importMesonAPI(Meson::BuildDir const& buildDir, Type type, QJsonObject* out); QString importMesonAPI(const Meson::BuildDir& buildDir, Type type, QJsonObject* out);
QString import(Meson::BuildDir buildDir); QString import(Meson::BuildDir buildDir);
void finished(); void finished();
......
...@@ -48,21 +48,21 @@ static const QHash<QString, MesonOptionBase::Type> STRING2TYPE = { ...@@ -48,21 +48,21 @@ static const QHash<QString, MesonOptionBase::Type> STRING2TYPE = {
{ QStringLiteral("string"), MesonOptionBase::STRING }, { QStringLiteral("string"), MesonOptionBase::STRING },
}; };
MesonOptions::MesonOptions(QJsonArray const& arr) MesonOptions::MesonOptions(const QJsonArray& arr)
{ {
fromJSON(arr); fromJSON(arr);
} }
// Option constructors // 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_name(name)
, m_description(description) , m_description(description)
, m_section(section) , 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) QStringList value)
: MesonOptionBase(name, description, section) : MesonOptionBase(name, description, section)
, m_value(value) , m_value(value)
...@@ -70,15 +70,16 @@ MesonOptionArray::MesonOptionArray(QString const& name, QString const& descripti ...@@ -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) : MesonOptionBase(name, description, section)
, m_value(value) , m_value(value)
, m_initialValue(value) , m_initialValue(value)
{ {
} }
MesonOptionCombo::MesonOptionCombo(QString const& name, QString const& description, MesonOptionBase::Section section, QString value, MesonOptionCombo::MesonOptionCombo(const QString& name, const QString& description, MesonOptionBase::Section section,
QStringList choices) QString value, QStringList choices)
: MesonOptionBase(name, description, section) : MesonOptionBase(name, description, section)
, m_value(value) , m_value(value)
, m_initialValue(value) , m_initialValue(value)
...@@ -86,14 +87,16 @@ MesonOptionCombo::MesonOptionCombo(QString const& name, QString const& descripti ...@@ -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) : MesonOptionBase(name, description, section)
, m_value(value) , m_value(value)
, m_initialValue(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) : MesonOptionBase(name, description, section)
, m_value(value) , m_value(value)
, m_initialValue(value) , m_initialValue(value)
...@@ -139,7 +142,7 @@ QString MesonOptionArray::value() const ...@@ -139,7 +142,7 @@ QString MesonOptionArray::value() const
QStringList tmp; QStringList tmp;
tmp.reserve(m_value.size()); tmp.reserve(m_value.size());
transform(begin(m_value), end(m_value), back_inserter(tmp), 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("]"); return QStringLiteral("[") + tmp.join(QStringLiteral(", ")) + QStringLiteral("]");
} }
...@@ -170,7 +173,7 @@ QString MesonOptionArray::initialValue() const ...@@ -170,7 +173,7 @@ QString MesonOptionArray::initialValue() const
QStringList tmp; QStringList tmp;
tmp.reserve(m_initialValue.size()); tmp.reserve(m_initialValue.size());
transform(begin(m_initialValue), end(m_initialValue), back_inserter(tmp), 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("]"); return QStringLiteral("[") + tmp.join(QStringLiteral(", ")) + QStringLiteral("]");
} }
...@@ -250,7 +253,7 @@ QString MesonOptionString::rawValue() const ...@@ -250,7 +253,7 @@ QString MesonOptionString::rawValue() const
// Set value functions // Set value functions
void MesonOptionArray::setValue(QStringList const& val) void MesonOptionArray::setValue(const QStringList& val)
{ {
m_value = val; m_value = val;
} }
...@@ -260,7 +263,7 @@ void MesonOptionBool::setValue(bool val) ...@@ -260,7 +263,7 @@ void MesonOptionBool::setValue(bool val)
m_value = val; m_value = val;
} }
void MesonOptionCombo::setValue(QString const& val) void MesonOptionCombo::setValue(const QString& val)
{ {
m_value = val; m_value = val;
} }
...@@ -270,34 +273,34 @@ void MesonOptionInteger::setValue(int val) ...@@ -270,34 +273,34 @@ void MesonOptionInteger::setValue(int val)
m_value = val; m_value = val;
} }
void MesonOptionString::setValue(QString const& val) void MesonOptionString::setValue(const QString& val)
{ {
m_value = val; m_value = val;
} }
// Set value from string // Set value from string
void MesonOptionArray::setFromString(QString const& value) void MesonOptionArray::setFromString(const QString& value)
{ {
setValue({ value }); setValue({ value });
} }
void MesonOptionBool::setFromString(QString const& value) void MesonOptionBool::setFromString(const QString& value)
{ {
setValue(value.toLower() == QLatin1String("true")); setValue(value.toLower() == QLatin1String("true"));
} }
void MesonOptionCombo::setFromString(QString const& value) void MesonOptionCombo::setFromString(const QString& value)
{ {
setValue(value); setValue(value);
} }
void MesonOptionInteger::setFromString(QString const& value) void MesonOptionInteger::setFromString(const QString& value)
{ {
setValue(value.toInt()); setValue(value.toInt());
} }
void MesonOptionString::setFromString(QString const& value) void MesonOptionString::setFromString(const QString& value)
{ {
setValue(value); setValue(value);
} }
...@@ -340,7 +343,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj) ...@@ -340,7 +343,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj)
auto valueJV = obj[QStringLiteral("value")]; auto valueJV = obj[QStringLiteral("value")];
// Check all values // Check all values
for (auto const& i : { nameJV, descriptionJV, sectionJV, typeJV }) { for (const auto& i : { nameJV, descriptionJV, sectionJV, typeJV }) {
if (!i.isString()) { if (!i.isString()) {
qCWarning(KDEV_Meson) << "OPT: Base type validation failed" << typeJV.toString(); qCWarning(KDEV_Meson) << "OPT: Base type validation failed" << typeJV.toString();
return nullptr; return nullptr;
...@@ -377,7 +380,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj) ...@@ -377,7 +380,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj)
QJsonArray raw = valueJV.toArray(); QJsonArray raw = valueJV.toArray();
QStringList values; QStringList values;
values.reserve(raw.size()); 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); return make_shared<MesonOptionArray>(name, description, section, values);
} }
...@@ -396,7 +399,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj) ...@@ -396,7 +399,7 @@ MesonOptionPtr MesonOptionBase::fromJSON(const QJsonObject& obj)
QJsonArray raw = choicesJV.toArray(); QJsonArray raw = choicesJV.toArray();
QStringList choices; QStringList choices;
choices.reserve(raw.size()); 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); return make_shared<MesonOptionCombo>(name, description, section, valueJV.toString(), choices);
} }
...@@ -446,7 +449,7 @@ void MesonOptions::fromJSON(const QJsonArray& arr) ...@@ -446,7 +449,7 @@ void MesonOptions::fromJSON(const QJsonArray& arr)
m_options.clear(); m_options.clear();
m_options.reserve(arr.size()); m_options.reserve(arr.size());
for (QJsonValue const& i : arr) { for (const QJsonValue& i : arr) {
if (!i.isObject()) { if (!i.isObject()) {
continue; continue;
} }
...@@ -462,7 +465,7 @@ void MesonOptions::fromJSON(const QJsonArray& arr) ...@@ -462,7 +465,7 @@ void MesonOptions::fromJSON(const QJsonArray& arr)
void MesonOptions::print() const 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(); qCDebug(KDEV_Meson) << i->name() << " = " << i->value() << " [" << i->type() << "] -- " << i->section();
} }
} }
......
...@@ -43,13 +43,13 @@ public: ...@@ -43,13 +43,13 @@ public:
enum Type { ARRAY, BOOLEAN, COMBO, INTEGER, STRING }; enum Type { ARRAY, BOOLEAN, COMBO, INTEGER, STRING };
public: public:
explicit MesonOptionBase(QString const& name, QString const& description, Section section); explicit MesonOptionBase(const QString& name, const QString& description, Section section);
virtual ~MesonOptionBase(); virtual ~MesonOptionBase();
virtual Type type() const = 0; virtual Type type() const = 0;
virtual QString value() const = 0; virtual QString value() const = 0;
virtual QString initialValue() 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; virtual void reset() = 0;
QString name() const; QString name() const;
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
QString mesonArg() const; QString mesonArg() const;
bool isUpdated() const; bool isUpdated() const;
static MesonOptionPtr fromJSON(QJsonObject const& obj); static MesonOptionPtr fromJSON(const QJsonObject& obj);
private: private:
QString m_name; QString m_name;
...@@ -70,16 +70,16 @@ private: ...@@ -70,16 +70,16 @@ private:
class MesonOptionArray : public MesonOptionBase class MesonOptionArray : public MesonOptionBase
{ {
public: 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; MesonOptionBase::Type type() const override;
QString value() const override; QString value() const override;
QString initialValue() const override; QString initialValue() const override;
void setFromString(QString const& value) override; void setFromString(const QString& value) override;
void reset() override; void reset() override;
QStringList rawValue() const; QStringList rawValue() const;
void setValue(QStringList const& val); void setValue(const QStringList& val);
private: private:
QStringList m_value; QStringList m_value;
...@@ -89,12 +89,12 @@ private: ...@@ -89,12 +89,12 @@ private:
class MesonOptionBool : public MesonOptionBase class MesonOptionBool : public MesonOptionBase
{ {
public: 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; MesonOptionBase::Type type() const override;
QString value() const override; QString value() const override;
QString initialValue() const override; QString initialValue() const override;
void setFromString(QString const& value) override; void setFromString(const QString& value) override;
void reset() override; void reset() override;
bool rawValue() const; bool rawValue() const;
...@@ -108,17 +108,17 @@ private: ...@@ -108,17 +108,17 @@ private:
class MesonOptionCombo : public MesonOptionBase class MesonOptionCombo : public MesonOptionBase
{ {
public: 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); QStringList choice