aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2022-02-09 13:55:14 +0100
committerFriedrich W. H. Kossebau <kossebau@kde.org>2022-02-18 22:24:41 +0000
commit3583e0d2ed951365777122ae4b2ab4641125f756 (patch)
tree8a4731ec1d0fc3f098e48994575d271711879898 /src
parent86adf52dfce9c1e8a3d0be54d159918c01ea919c (diff)
downloadkconfig-3583e0d2ed951365777122ae4b2ab4641125f756.tar.gz
kconfig-3583e0d2ed951365777122ae4b2ab4641125f756.tar.bz2
KConfigCompiler: support ItemAccessors=true with signalling items
Diffstat (limited to 'src')
-rw-r--r--src/kconfig_compiler/KConfigHeaderGenerator.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/kconfig_compiler/KConfigHeaderGenerator.cpp b/src/kconfig_compiler/KConfigHeaderGenerator.cpp
index ea5a2c75..24b8107f 100644
--- a/src/kconfig_compiler/KConfigHeaderGenerator.cpp
+++ b/src/kconfig_compiler/KConfigHeaderGenerator.cpp
@@ -508,10 +508,13 @@ void KConfigHeaderGenerator::createItemAcessors(const CfgEntry *entry, const QSt
if (!cfg().itemAccessors) {
return;
}
+
+ const QString declType = entry->signalList.isEmpty() ? QStringLiteral("Item") + itemType(entry->type) : QStringLiteral("KConfigCompilerSignallingItem");
+
stream() << whitespace() << "/**\n";
stream() << whitespace() << " Get Item object corresponding to " << entry->name << "()" << '\n';
stream() << whitespace() << "*/\n";
- stream() << whitespace() << "Item" << itemType(entry->type) << " *" << getFunction(entry->name) << "Item(";
+ stream() << whitespace() << declType << " *" << getFunction(entry->name) << "Item(";
if (!entry->param.isEmpty()) {
stream() << " " << cppType(entry->paramType) << " i ";
}
@@ -625,7 +628,9 @@ void KConfigHeaderGenerator::createNonDPointerHelpers()
stream() << "\n private:\n";
if (cfg().itemAccessors) {
for (const auto *entry : std::as_const(parseResult.entries)) {
- stream() << whitespace() << "Item" << itemType(entry->type) << " *" << itemVar(entry, cfg());
+ const QString declType =
+ entry->signalList.isEmpty() ? QStringLiteral("Item") + itemType(entry->type) : QStringLiteral("KConfigCompilerSignallingItem");
+ stream() << whitespace() << declType << " *" << itemVar(entry, cfg());
if (!entry->param.isEmpty()) {
stream() << QStringLiteral("[%1]").arg(entry->paramMax + 1);
}