aboutsummaryrefslogtreecommitdiff
path: root/src/kconfig_compiler
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2021-08-13 02:10:47 +0200
committerAhmad Samir <a.samirh78@gmail.com>2021-08-13 02:12:26 +0200
commit783d1c28c88229f81715f6ecd1cf3866855252a2 (patch)
treeaff64f5f6f22f92ff5ae5ff9413d1b250470b4e4 /src/kconfig_compiler
parent17c179566d764d9a55b6ae98006495133bcffdbf (diff)
downloadkconfig-783d1c28c88229f81715f6ecd1cf3866855252a2.tar.gz
kconfig-783d1c28c88229f81715f6ecd1cf3866855252a2.tar.bz2
clang-tidy: one declaration per line; braces around statements
clang-tidy checks: readability-isolate-declaration and readability-braces-around-statements KF task: https://phabricator.kde.org/T14729 GIT_SILENT
Diffstat (limited to 'src/kconfig_compiler')
-rw-r--r--src/kconfig_compiler/KConfigHeaderGenerator.cpp5
-rw-r--r--src/kconfig_compiler/KConfigSourceGenerator.cpp6
-rw-r--r--src/kconfig_compiler/KConfigXmlParser.cpp8
-rw-r--r--src/kconfig_compiler/kconfig_compiler.cpp6
4 files changed, 15 insertions, 10 deletions
diff --git a/src/kconfig_compiler/KConfigHeaderGenerator.cpp b/src/kconfig_compiler/KConfigHeaderGenerator.cpp
index bf29da05..24829ff5 100644
--- a/src/kconfig_compiler/KConfigHeaderGenerator.cpp
+++ b/src/kconfig_compiler/KConfigHeaderGenerator.cpp
@@ -319,10 +319,11 @@ void KConfigHeaderGenerator::createConstructor()
stream() << whitespace() << "" << cfg().className << "(";
if (parseResult.cfgFileNameArg) {
- if (cfg().forceStringFilename)
+ if (cfg().forceStringFilename) {
stream() << " const QString &cfgfilename" << (parseResult.parameters.isEmpty() ? " = QString()" : ", ");
- else
+ } else {
stream() << " KSharedConfig::Ptr config" << (parseResult.parameters.isEmpty() ? " = KSharedConfig::openConfig()" : ", ");
+ }
}
bool first = true;
diff --git a/src/kconfig_compiler/KConfigSourceGenerator.cpp b/src/kconfig_compiler/KConfigSourceGenerator.cpp
index d308ffcd..e221d1ab 100644
--- a/src/kconfig_compiler/KConfigSourceGenerator.cpp
+++ b/src/kconfig_compiler/KConfigSourceGenerator.cpp
@@ -674,11 +674,13 @@ void KConfigSourceGenerator::createSignalFlagsHandler()
stream() << '\n';
stream() << "void " << cfg().className << "::"
<< "itemChanged(quint64 flags) {\n";
- if (parseResult.hasNonModifySignals)
+ if (parseResult.hasNonModifySignals) {
stream() << " " << varPath(QStringLiteral("settingsChanged"), cfg()) << " |= flags;\n";
+ }
- if (!parseResult.signalList.isEmpty())
+ if (!parseResult.signalList.isEmpty()) {
stream() << '\n';
+ }
for (const Signal &signal : qAsConst(parseResult.signalList)) {
if (signal.modify) {
diff --git a/src/kconfig_compiler/KConfigXmlParser.cpp b/src/kconfig_compiler/KConfigXmlParser.cpp
index 5b2fb775..3d054522 100644
--- a/src/kconfig_compiler/KConfigXmlParser.cpp
+++ b/src/kconfig_compiler/KConfigXmlParser.cpp
@@ -371,24 +371,24 @@ CfgEntry *KConfigXmlParser::parseEntry(const QString &group, const QString &pare
readParamDefaultValues(readEntry, element);
if (!mValidNameRegexp.match(readEntry.name).hasMatch()) {
- if (nameIsEmpty)
+ if (nameIsEmpty) {
std::cerr << "The key '" << qPrintable(readEntry.key)
<< "' can not be used as name for the entry because "
"it is not a valid name. You need to specify a valid name for this entry."
<< std::endl;
- else {
+ } else {
std::cerr << "The name '" << qPrintable(readEntry.name) << "' is not a valid name for an entry." << std::endl;
}
exit(1);
}
if (mAllNames.contains(readEntry.name)) {
- if (nameIsEmpty)
+ if (nameIsEmpty) {
std::cerr << "The key '" << qPrintable(readEntry.key)
<< "' can not be used as name for the entry because "
"it does not result in a unique name. You need to specify a unique name for this entry."
<< std::endl;
- else {
+ } else {
std::cerr << "The name '" << qPrintable(readEntry.name) << "' is not unique." << std::endl;
}
exit(1);
diff --git a/src/kconfig_compiler/kconfig_compiler.cpp b/src/kconfig_compiler/kconfig_compiler.cpp
index 28b10e4f..761e64fc 100644
--- a/src/kconfig_compiler/kconfig_compiler.cpp
+++ b/src/kconfig_compiler/kconfig_compiler.cpp
@@ -645,10 +645,11 @@ QString indent(QString text, int spaces)
QString currLine;
while (!in.atEnd()) {
currLine = in.readLine();
- if (!currLine.isEmpty())
+ if (!currLine.isEmpty()) {
for (int i = 0; i < spaces; ++i) {
out << " ";
}
+ }
out << currLine << '\n';
}
return result;
@@ -700,7 +701,8 @@ int main(int argc, char **argv)
app.setApplicationName(QStringLiteral("kconfig_compiler"));
app.setApplicationVersion(QStringLiteral(KCONFIG_VERSION_STRING));
- QString inputFilename, codegenFilename;
+ QString inputFilename;
+ QString codegenFilename;
QCommandLineOption targetDirectoryOption(QStringList{QStringLiteral("d"), QStringLiteral("directory")},
QCoreApplication::translate("main", "Directory to generate files in [.]"),