diff options
author | hjk <hjk121@nokiamail.com> | 2014-10-13 12:49:05 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-10-15 00:49:17 +0200 |
commit | e279c7e00787230dcd89301ebb7a182a35c0531b (patch) | |
tree | 1f43783b3bae7d3735a36807f040fd3aa1bb5556 /src/plugins/cpptools | |
parent | e43af30faabaf3f38a6a652c519c61512203054f (diff) | |
download | qt-creator-e279c7e00787230dcd89301ebb7a182a35c0531b.tar.gz |
MacroExpander: Allow registering local expansions
This allows a MacroExpander also to describe an expansion it can
do which was restricted to the global VariableManager only.
The global is now just a thin (unneeded) wrapper about new "standard"
functionality.
Change-Id: Ida7ca70cf3d319eae4220ea8d12f3dd1c0d4042c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r-- | src/plugins/cpptools/cpptoolsplugin.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 34787ff9c7..757d3c9aca 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -191,12 +191,13 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) mcpptools->addAction(command); connect(openInNextSplitAction, SIGNAL(triggered()), this, SLOT(switchHeaderSourceInNextSplit())); - Core::VariableManager::registerVariable("Cpp:LicenseTemplate", - tr("The license template."), - [this]() { return CppToolsPlugin::licenseTemplate(); }); - Core::VariableManager::registerFileVariables("Cpp:LicenseTemplatePath", - tr("The configured path to the license template"), - [this]() { return CppToolsPlugin::licenseTemplatePath().toString(); }); + Utils::MacroExpander *expander = globalMacroExpander(); + expander->registerVariable("Cpp:LicenseTemplate", + tr("The license template."), + [this]() { return CppToolsPlugin::licenseTemplate(); }); + expander->registerFileVariables("Cpp:LicenseTemplatePath", + tr("The configured path to the license template"), + [this]() { return CppToolsPlugin::licenseTemplatePath().toString(); }); return true; } |