diff options
author | l10n daemon script <scripty@kde.org> | 2016-12-07 09:06:25 +0000 |
---|---|---|
committer | l10n daemon script <scripty@kde.org> | 2016-12-07 09:06:25 +0000 |
commit | 6e2a0fd0f427a665a9e65e6b226db10c5116c67f (patch) | |
tree | 6e051bf0819831b528c71e9454eaf0ab0dc1f238 /src/kconfig_compiler | |
parent | b7cc6bd8755515c0f84932926a44c42723c26c11 (diff) | |
parent | 4f9d7dde3a06da26d93e8f7ec98a283111a2d8c9 (diff) | |
download | kconfig-6e2a0fd0f427a665a9e65e6b226db10c5116c67f.tar.gz kconfig-6e2a0fd0f427a665a9e65e6b226db10c5116c67f.tar.bz2 |
Merge remote-tracking branch 'origin/master' into local_releasev5.29.0-rc2v5.29.0
Diffstat (limited to 'src/kconfig_compiler')
-rw-r--r-- | src/kconfig_compiler/kconfig_compiler.cpp | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/src/kconfig_compiler/kconfig_compiler.cpp b/src/kconfig_compiler/kconfig_compiler.cpp index 99ecff7d..121bea4f 100644 --- a/src/kconfig_compiler/kconfig_compiler.cpp +++ b/src/kconfig_compiler/kconfig_compiler.cpp @@ -1893,7 +1893,6 @@ int main(int argc, char **argv) h << " static " << cfg.className << " *self();" << endl; if (cfgFileNameArg) { h << " static void instance(const QString& cfgfilename);" << endl; - h << " static void instance(KSharedConfig::Ptr config);" << endl; } } @@ -2116,7 +2115,7 @@ int main(int argc, char **argv) if (cfg.singleton) { h << " " << cfg.className << "("; if (cfgFileNameArg) { - h << "KSharedConfig::Ptr config"; + h << "const QString& arg"; } h << ");" << endl; h << " friend class " << cfg.className << "Helper;" << endl << endl; @@ -2321,25 +2320,15 @@ int main(int argc, char **argv) cpp << "}" << endl << endl; if (cfgFileNameArg) { - auto instance = [&cfg, &cpp] (const QString &type, const QString arg, bool wrap) { - cpp << "void " << cfg.className << "::instance(" << type << " " << arg << ")" << endl; - cpp << "{" << endl; - cpp << " if (s_global" << cfg.className << "()->q) {" << endl; - cpp << " qDebug() << \"" << cfg.className << "::instance called after the first use - ignoring\";" << endl; - cpp << " return;" << endl; - cpp << " }" << endl; - cpp << " new " << cfg.className << "("; - if (wrap) { - cpp << "KSharedConfig::openConfig(" << arg << ")"; - } else { - cpp << arg; - } - cpp << ");" << endl; - cpp << " s_global" << cfg.className << "()->q->read();" << endl; - cpp << "}" << endl << endl; - }; - instance(QStringLiteral("const QString&"), QStringLiteral("cfgfilename"), true); - instance(QStringLiteral("KSharedConfig::Ptr"), QStringLiteral("config"), false); + cpp << "void " << cfg.className << "::instance(const QString& cfgfilename)" << endl; + cpp << "{" << endl; + cpp << " if (s_global" << cfg.className << "()->q) {" << endl; + cpp << " qDebug() << \"" << cfg.className << "::instance called after the first use - ignoring\";" << endl; + cpp << " return;" << endl; + cpp << " }" << endl; + cpp << " new " << cfg.className << "(cfgfilename);" << endl; + cpp << " s_global" << cfg.className << "()->q->read();" << endl; + cpp << "}" << endl << endl; } } @@ -2350,7 +2339,7 @@ int main(int argc, char **argv) // Constructor cpp << cfg.className << "::" << cfg.className << "( "; if (cfgFileNameArg) { - if (! cfg.forceStringFilename) { + if (!cfg.singleton && ! cfg.forceStringFilename) { cpp << " KSharedConfig::Ptr config"; } else { cpp << " const QString& config"; |