forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user