From e83c46c222095265080eb50b32d69a24297e9310 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Fri, 24 Jan 2020 08:02:19 +0100 Subject: Port endl to \n as it's qt namespaced. Port "dec"/"hex" as it's Qt namespaced too --- src/kconfig_compiler/KConfigHeaderGenerator.cpp | 20 +++++++++++++++++--- src/kconfig_compiler/KConfigSourceGenerator.cpp | 14 +++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/kconfig_compiler/KConfigHeaderGenerator.cpp b/src/kconfig_compiler/KConfigHeaderGenerator.cpp index 47f5358e..5b828ec8 100644 --- a/src/kconfig_compiler/KConfigHeaderGenerator.cpp +++ b/src/kconfig_compiler/KConfigHeaderGenerator.cpp @@ -255,7 +255,14 @@ void KConfigHeaderGenerator::createSignals() // a last comma, as it's valid c++. for (int i = 0, end = parseResult.signalList.size(); i < end; i++) { auto signal = parseResult.signalList.at(i); - stream() << whitespace() << " " << signalEnumName(signal.name) << " = 0x" << hex << val; + stream() << whitespace() << " " << signalEnumName(signal.name) << " = 0x" + << + #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) + hex + #else + Qt::hex + #endif + << val; if (i != end-1) { stream() << ",\n"; } @@ -263,7 +270,14 @@ void KConfigHeaderGenerator::createSignals() val <<= 1; } stream() << '\n'; - stream() << whitespace() << "};" << dec << "\n\n"; + stream() << whitespace() << "};" + << + #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) + dec + #else + Qt::dec + #endif + << "\n\n"; stream() << " Q_SIGNALS:"; for (const Signal &signal : parseResult.signalList) { @@ -495,7 +509,7 @@ void KConfigHeaderGenerator::createItemAcessors(const CfgEntry *entry, const QSt stream() << ";\n"; } - stream() <q) {\n"; stream() << " new " << cfg().className << ';' << '\n'; stream() << " s_global" << cfg().className << "()->q->read();\n"; - stream() << " }" << endl << '\n'; + stream() << " }\n\n"; } stream() << " return s_global" << cfg().className << "()->q;\n"; - stream() << "}" << endl << '\n'; + stream() << "}\n\n"; if (parseResult.cfgFileNameArg) { auto instance = [this] (const QString &type, const QString &arg, bool isString) { @@ -194,7 +194,7 @@ void KConfigSourceGenerator::createSingletonImplementation() } stream() << ");\n"; stream() << " s_global" << cfg().className << "()->q->read();\n"; - stream() << "}" << endl << '\n'; + stream() << "}\n\n"; }; instance(QStringLiteral("const QString&"), QStringLiteral("cfgfilename"), true); instance(QStringLiteral("KSharedConfig::Ptr"), QStringLiteral("config"), false); @@ -388,7 +388,7 @@ void KConfigSourceGenerator::handleCurrentGroupChange(const CfgEntry *entry) mCurrentGroup = entry->group; stream() << " setCurrentGroup( " << paramString(mCurrentGroup, parseResult.parameters) << " );"; - stream() << endl << '\n'; + stream() << "\n\n"; } void KConfigSourceGenerator::doConstructor() -- cgit v1.2.1