From 09eeab7737e4728bf9184509e68861bae9d0b0db Mon Sep 17 00:00:00 2001 From: Alexis Jeandet Date: Tue, 27 Oct 2020 22:36:27 +0100 Subject: [PATCH] Meson: partially clang-format all files Change-Id: Ie621792417e89aa732311129f0cfa99a5147183a Reviewed-by: Alexis Jeandet Reviewed-by: Christian Stenger --- .../exewrappers/mesontools.h | 1 - .../exewrappers/mesonwrapper.cpp | 4 ++-- .../exewrappers/mesonwrapper.h | 22 +++++++++---------- .../parsers/buildsystemfilesparser.h | 3 +-- .../mesoninfoparser/parsers/common.h | 4 +--- .../buildoptions/mesonbuildsettingswidget.h | 1 - .../settings/tools/toolsmodel.cpp | 3 +-- .../settings/tools/tooltreeitem.h | 2 +- 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/plugins/mesonprojectmanager/exewrappers/mesontools.h b/src/plugins/mesonprojectmanager/exewrappers/mesontools.h index f3d4f128876..4a1fe53fc98 100644 --- a/src/plugins/mesonprojectmanager/exewrappers/mesontools.h +++ b/src/plugins/mesonprojectmanager/exewrappers/mesontools.h @@ -46,7 +46,6 @@ class MesonTools : public QObject public: using Tool_t = std::shared_ptr; - static bool isMesonWrapper(const Tool_t &tool); static bool isNinjaWrapper(const Tool_t &tool); diff --git a/src/plugins/mesonprojectmanager/exewrappers/mesonwrapper.cpp b/src/plugins/mesonprojectmanager/exewrappers/mesonwrapper.cpp index cfc30dc9547..4e1fa226810 100644 --- a/src/plugins/mesonprojectmanager/exewrappers/mesonwrapper.cpp +++ b/src/plugins/mesonprojectmanager/exewrappers/mesonwrapper.cpp @@ -36,14 +36,14 @@ void impl_option_cat(QStringList &list, const First &first) } template -void impl_option_cat(QStringList &list, const First &first, const T &... args) +void impl_option_cat(QStringList &list, const First &first, const T &...args) { impl_option_cat(list, first); impl_option_cat(list, args...); } template -QStringList options_cat(const T &... args) +QStringList options_cat(const T &...args) { QStringList result; impl_option_cat(result, args...); diff --git a/src/plugins/mesonprojectmanager/exewrappers/mesonwrapper.h b/src/plugins/mesonprojectmanager/exewrappers/mesonwrapper.h index 7053244f623..92893923c34 100644 --- a/src/plugins/mesonprojectmanager/exewrappers/mesonwrapper.h +++ b/src/plugins/mesonprojectmanager/exewrappers/mesonwrapper.h @@ -47,7 +47,7 @@ bool containsFiles(const QString &path, const File_t &file) } template -bool containsFiles(const QString &path, const File_t &file, const T &... files) +bool containsFiles(const QString &path, const File_t &file, const T &...files) { return containsFiles(path, file) && containsFiles(path, files...); } @@ -69,14 +69,14 @@ inline bool isSetup(const Utils::FilePath &buildPath) { using namespace Utils; return containsFiles(buildPath.pathAppended(Constants::MESON_INFO_DIR).toString(), - Constants::MESON_INTRO_TESTS, - Constants::MESON_INTRO_TARGETS, - Constants::MESON_INTRO_INSTALLED, - Constants::MESON_INTRO_BENCHMARKS, - Constants::MESON_INTRO_BUIDOPTIONS, - Constants::MESON_INTRO_PROJECTINFO, - Constants::MESON_INTRO_DEPENDENCIES, - Constants::MESON_INTRO_BUILDSYSTEM_FILES); + Constants::MESON_INTRO_TESTS, + Constants::MESON_INTRO_TARGETS, + Constants::MESON_INTRO_INSTALLED, + Constants::MESON_INTRO_BENCHMARKS, + Constants::MESON_INTRO_BUIDOPTIONS, + Constants::MESON_INTRO_PROJECTINFO, + Constants::MESON_INTRO_DEPENDENCIES, + Constants::MESON_INTRO_BUILDSYSTEM_FILES); } class MesonWrapper final : public ToolWrapper @@ -92,13 +92,13 @@ public: const QStringList &options = {}) const; Command regenerate(const Utils::FilePath &sourceDirectory, - const Utils::FilePath &buildDirectory)const; + const Utils::FilePath &buildDirectory) const; Command introspect(const Utils::FilePath &sourceDirectory) const; static inline Utils::optional find() { - return ToolWrapper::findTool({"meson.py","meson"}); + return ToolWrapper::findTool({"meson.py", "meson"}); } static inline QString toolName() { return {"Meson"}; }; diff --git a/src/plugins/mesonprojectmanager/mesoninfoparser/parsers/buildsystemfilesparser.h b/src/plugins/mesonprojectmanager/mesoninfoparser/parsers/buildsystemfilesparser.h index c2dd9c5bcc0..2bd9a469728 100644 --- a/src/plugins/mesonprojectmanager/mesoninfoparser/parsers/buildsystemfilesparser.h +++ b/src/plugins/mesonprojectmanager/mesoninfoparser/parsers/buildsystemfilesparser.h @@ -38,8 +38,7 @@ namespace Internal { class BuildSystemFilesParser { std::vector m_files; - static void appendFiles(const Utils::optional &arr, - std::vector &dest) + static void appendFiles(const Utils::optional &arr, std::vector &dest) { if (arr) std::transform(std::cbegin(*arr), diff --git a/src/plugins/mesonprojectmanager/mesoninfoparser/parsers/common.h b/src/plugins/mesonprojectmanager/mesoninfoparser/parsers/common.h index a5113a7700f..081b93771e5 100644 --- a/src/plugins/mesonprojectmanager/mesoninfoparser/parsers/common.h +++ b/src/plugins/mesonprojectmanager/mesoninfoparser/parsers/common.h @@ -101,9 +101,7 @@ inline Utils::optional get(const QJsonObject &obj, con } template -inline Utils::optional get(const QJsonObject &obj, - const QString &firstPath, - const Strings &... path) +inline Utils::optional get(const QJsonObject &obj, const QString &firstPath, const Strings &...path) { if (obj.contains(firstPath)) return get(obj[firstPath].toObject(), path...); diff --git a/src/plugins/mesonprojectmanager/project/buildoptions/mesonbuildsettingswidget.h b/src/plugins/mesonprojectmanager/project/buildoptions/mesonbuildsettingswidget.h index 68f677c41f0..b5fec334eb2 100644 --- a/src/plugins/mesonprojectmanager/project/buildoptions/mesonbuildsettingswidget.h +++ b/src/plugins/mesonprojectmanager/project/buildoptions/mesonbuildsettingswidget.h @@ -32,7 +32,6 @@ #include #include - namespace MesonProjectManager { namespace Internal { diff --git a/src/plugins/mesonprojectmanager/settings/tools/toolsmodel.cpp b/src/plugins/mesonprojectmanager/settings/tools/toolsmodel.cpp index f30d6b5b534..f0ab43e45f7 100644 --- a/src/plugins/mesonprojectmanager/settings/tools/toolsmodel.cpp +++ b/src/plugins/mesonprojectmanager/settings/tools/toolsmodel.cpp @@ -81,13 +81,12 @@ void ToolsModel::apply() if (item->hasUnsavedChanges()) { MesonTools::updateTool(item->id(), item->name(), item->executable()); item->setSaved(); - emit this->dataChanged(item->index(),item->index()); + emit this->dataChanged(item->index(), item->index()); } }); while (!m_itemsToRemove.isEmpty()) { MesonTools::removeTool(m_itemsToRemove.dequeue()); } - } void ToolsModel::addMesonTool(const MesonTools::Tool_t &tool) diff --git a/src/plugins/mesonprojectmanager/settings/tools/tooltreeitem.h b/src/plugins/mesonprojectmanager/settings/tools/tooltreeitem.h index 6b6946364e0..9937ac9a3f7 100644 --- a/src/plugins/mesonprojectmanager/settings/tools/tooltreeitem.h +++ b/src/plugins/mesonprojectmanager/settings/tools/tooltreeitem.h @@ -26,8 +26,8 @@ #pragma once #include "toolssettingspage.h" #include -#include #include +#include #include #include #include