diff options
| author | Kai Uwe Broulik <kde@privat.broulik.de> | 2019-04-24 16:20:56 +0200 | 
|---|---|---|
| committer | Kai Uwe Broulik <kde@privat.broulik.de> | 2019-04-24 16:21:29 +0200 | 
| commit | 5d2ed13479a480111355657bf22324118fa576e9 (patch) | |
| tree | d55fe47fa3d017391b8c6c1a735d4b098adbe8f8 /src/kconfig_compiler | |
| parent | b327f5f6cef127980e84926b134d5c7c72e833b1 (diff) | |
| download | kconfig-5d2ed13479a480111355657bf22324118fa576e9.tar.gz kconfig-5d2ed13479a480111355657bf22324118fa576e9.tar.bz2  | |
Add Notify capability to KConfigXT
Lets you specify Notifiers= in .kcfg for config entries that should be written with Notify flag,
i.e. announce the change to KConfigWatcher
Differential Revision: https://phabricator.kde.org/D20196
Diffstat (limited to 'src/kconfig_compiler')
| -rw-r--r-- | src/kconfig_compiler/kconfig_compiler.cpp | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kconfig_compiler/kconfig_compiler.cpp b/src/kconfig_compiler/kconfig_compiler.cpp index b467a20a..abb8e115 100644 --- a/src/kconfig_compiler/kconfig_compiler.cpp +++ b/src/kconfig_compiler/kconfig_compiler.cpp @@ -94,6 +94,8 @@ public:          setUserTexts = codegenConfig.value(QStringLiteral("SetUserTexts"), false).toBool();          defaultGetters = codegenConfig.value(QStringLiteral("DefaultValueGetters"), QStringList()).toStringList();          allDefaultGetters = (defaultGetters.count() == 1) && (defaultGetters.at(0).toLower() == QLatin1String("true")); +        notifiers = codegenConfig.value(QStringLiteral("Notifiers"), QStringList()).toStringList(); +        allNotifiers = ((notifiers.count() == 1) && (notifiers.at(0).toLower() == QLatin1String("true")));          globalEnums = codegenConfig.value(QStringLiteral("GlobalEnums"), false).toBool();          useEnumTypes = codegenConfig.value(QStringLiteral("UseEnumTypes"), false).toBool();          const QString trString = codegenConfig.value(QStringLiteral("TranslationSystem")).toString().toLower(); @@ -132,6 +134,7 @@ public:      QStringList sourceIncludes;      QStringList mutators;      QStringList defaultGetters; +    QStringList notifiers;      QString qCategoryLoggingName;      QString headerExtension;      QString sourceExtension; @@ -142,6 +145,7 @@ public:      bool globalEnums;      bool useEnumTypes;      bool itemAccessors; +    bool allNotifiers;      TranslationSystem translationSystem;      QString translationDomain;      bool generateProperties; @@ -2484,6 +2488,10 @@ int main(int argc, char **argv)                  cpp << userTextsFunctions((*itEntry), cfg);              } +            if (cfg.allNotifiers || cfg.notifiers.contains((*itEntry)->name())) { +                cpp << "  " << itemPath(*itEntry, cfg) << "->setWriteFlags(KConfigBase::Notify);" << endl; +            } +              cpp << "  addItem( " << itemPath(*itEntry, cfg);              QString quotedName = (*itEntry)->name();              addQuotes(quotedName);  | 
