Changeset View
Changeset View
Standalone View
Standalone View
src/kconfig_compiler/kconfig_compiler.cpp
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 65 | { | |||
---|---|---|---|---|---|
89 | headerIncludes = codegenConfig.value(QStringLiteral("IncludeFiles"), QStringList()).toStringList(); | 89 | headerIncludes = codegenConfig.value(QStringLiteral("IncludeFiles"), QStringList()).toStringList(); | ||
90 | sourceIncludes = codegenConfig.value(QStringLiteral("SourceIncludeFiles"), QStringList()).toStringList(); | 90 | sourceIncludes = codegenConfig.value(QStringLiteral("SourceIncludeFiles"), QStringList()).toStringList(); | ||
91 | mutators = codegenConfig.value(QStringLiteral("Mutators"), QStringList()).toStringList(); | 91 | mutators = codegenConfig.value(QStringLiteral("Mutators"), QStringList()).toStringList(); | ||
92 | allMutators = ((mutators.count() == 1) && (mutators.at(0).toLower() == QLatin1String("true"))); | 92 | allMutators = ((mutators.count() == 1) && (mutators.at(0).toLower() == QLatin1String("true"))); | ||
93 | itemAccessors = codegenConfig.value(QStringLiteral("ItemAccessors"), false).toBool(); | 93 | itemAccessors = codegenConfig.value(QStringLiteral("ItemAccessors"), false).toBool(); | ||
94 | setUserTexts = codegenConfig.value(QStringLiteral("SetUserTexts"), false).toBool(); | 94 | setUserTexts = codegenConfig.value(QStringLiteral("SetUserTexts"), false).toBool(); | ||
95 | defaultGetters = codegenConfig.value(QStringLiteral("DefaultValueGetters"), QStringList()).toStringList(); | 95 | defaultGetters = codegenConfig.value(QStringLiteral("DefaultValueGetters"), QStringList()).toStringList(); | ||
96 | allDefaultGetters = (defaultGetters.count() == 1) && (defaultGetters.at(0).toLower() == QLatin1String("true")); | 96 | allDefaultGetters = (defaultGetters.count() == 1) && (defaultGetters.at(0).toLower() == QLatin1String("true")); | ||
97 | notifiers = codegenConfig.value(QStringLiteral("Notifiers"), QStringList()).toStringList(); | ||||
98 | allNotifiers = ((notifiers.count() == 1) && (notifiers.at(0).toLower() == QLatin1String("true"))); | ||||
97 | globalEnums = codegenConfig.value(QStringLiteral("GlobalEnums"), false).toBool(); | 99 | globalEnums = codegenConfig.value(QStringLiteral("GlobalEnums"), false).toBool(); | ||
98 | useEnumTypes = codegenConfig.value(QStringLiteral("UseEnumTypes"), false).toBool(); | 100 | useEnumTypes = codegenConfig.value(QStringLiteral("UseEnumTypes"), false).toBool(); | ||
99 | const QString trString = codegenConfig.value(QStringLiteral("TranslationSystem")).toString().toLower(); | 101 | const QString trString = codegenConfig.value(QStringLiteral("TranslationSystem")).toString().toLower(); | ||
100 | generateProperties = codegenConfig.value(QStringLiteral("GenerateProperties"), false).toBool(); | 102 | generateProperties = codegenConfig.value(QStringLiteral("GenerateProperties"), false).toBool(); | ||
101 | if (trString == QLatin1String("kde")) { | 103 | if (trString == QLatin1String("kde")) { | ||
102 | translationSystem = KdeTranslation; | 104 | translationSystem = KdeTranslation; | ||
103 | translationDomain = codegenConfig.value(QStringLiteral("TranslationDomain")).toString(); | 105 | translationDomain = codegenConfig.value(QStringLiteral("TranslationDomain")).toString(); | ||
104 | } else { | 106 | } else { | ||
Show All 22 Lines | 117 | public: | |||
127 | bool singleton; // The class will be a singleton | 129 | bool singleton; // The class will be a singleton | ||
128 | bool staticAccessors; // provide or not static accessors | 130 | bool staticAccessors; // provide or not static accessors | ||
129 | bool customAddons; | 131 | bool customAddons; | ||
130 | QString memberVariables; | 132 | QString memberVariables; | ||
131 | QStringList headerIncludes; | 133 | QStringList headerIncludes; | ||
132 | QStringList sourceIncludes; | 134 | QStringList sourceIncludes; | ||
133 | QStringList mutators; | 135 | QStringList mutators; | ||
134 | QStringList defaultGetters; | 136 | QStringList defaultGetters; | ||
137 | QStringList notifiers; | ||||
135 | QString qCategoryLoggingName; | 138 | QString qCategoryLoggingName; | ||
136 | QString headerExtension; | 139 | QString headerExtension; | ||
137 | QString sourceExtension; | 140 | QString sourceExtension; | ||
138 | bool allMutators; | 141 | bool allMutators; | ||
139 | bool setUserTexts; | 142 | bool setUserTexts; | ||
140 | bool allDefaultGetters; | 143 | bool allDefaultGetters; | ||
141 | bool dpointer; | 144 | bool dpointer; | ||
142 | bool globalEnums; | 145 | bool globalEnums; | ||
143 | bool useEnumTypes; | 146 | bool useEnumTypes; | ||
144 | bool itemAccessors; | 147 | bool itemAccessors; | ||
148 | bool allNotifiers; | ||||
145 | TranslationSystem translationSystem; | 149 | TranslationSystem translationSystem; | ||
146 | QString translationDomain; | 150 | QString translationDomain; | ||
147 | bool generateProperties; | 151 | bool generateProperties; | ||
148 | }; | 152 | }; | ||
149 | 153 | | |||
150 | struct SignalArguments { | 154 | struct SignalArguments { | ||
151 | QString type; | 155 | QString type; | ||
152 | QString variableName; | 156 | QString variableName; | ||
▲ Show 20 Lines • Show All 1982 Lines • ▼ Show 20 Line(s) | 2475 | if ((*itEntry)->param().isEmpty()) { | |||
2479 | if (!(*itEntry)->maxValue().isEmpty()) { | 2483 | if (!(*itEntry)->maxValue().isEmpty()) { | ||
2480 | cpp << " " << itemPath(*itEntry, cfg) << "->setMaxValue(" << (*itEntry)->maxValue() << ");" << endl; | 2484 | cpp << " " << itemPath(*itEntry, cfg) << "->setMaxValue(" << (*itEntry)->maxValue() << ");" << endl; | ||
2481 | } | 2485 | } | ||
2482 | 2486 | | |||
2483 | if (cfg.setUserTexts) { | 2487 | if (cfg.setUserTexts) { | ||
2484 | cpp << userTextsFunctions((*itEntry), cfg); | 2488 | cpp << userTextsFunctions((*itEntry), cfg); | ||
2485 | } | 2489 | } | ||
2486 | 2490 | | |||
2491 | if (cfg.allNotifiers || cfg.notifiers.contains((*itEntry)->name())) { | ||||
2492 | cpp << " " << itemPath(*itEntry, cfg) << "->setWriteFlags(KConfigBase::Notify);" << endl; | ||||
2493 | } | ||||
2494 | | ||||
2487 | cpp << " addItem( " << itemPath(*itEntry, cfg); | 2495 | cpp << " addItem( " << itemPath(*itEntry, cfg); | ||
2488 | QString quotedName = (*itEntry)->name(); | 2496 | QString quotedName = (*itEntry)->name(); | ||
2489 | addQuotes(quotedName); | 2497 | addQuotes(quotedName); | ||
2490 | if (quotedName != key) { | 2498 | if (quotedName != key) { | ||
2491 | cpp << ", QStringLiteral( \"" << (*itEntry)->name() << "\" )"; | 2499 | cpp << ", QStringLiteral( \"" << (*itEntry)->name() << "\" )"; | ||
2492 | } | 2500 | } | ||
2493 | cpp << " );" << endl; | 2501 | cpp << " );" << endl; | ||
2494 | } else { | 2502 | } else { | ||
▲ Show 20 Lines • Show All 201 Lines • Show Last 20 Lines |