MacroExpander: Allow "comment" expansion

%{#: is now treated as a comment and expands to an empty string }

This is useful to add comments about copyright, etc. into the
wizard templates.

Change-Id: I6e25c724edfa4b865d2d4f74b0f4900982d9ea47
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-06-04 16:25:38 +02:00
parent 33a1220019
commit 01a5f9cfc7

View File

@@ -211,6 +211,8 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
expander->registerPrefix("CurrentTime:", tr("The current time (QTime formatstring)."),
[](const QString &fmt) { return QTime::currentTime().toString(fmt); });
expander->registerPrefix("#:", tr("A comment."), [](const QString &) { return QStringLiteral(""); });
// Make sure all wizards are there when the user might access the keyboard shortcuts:
connect(ICore::instance(), &ICore::optionsDialogRequested, []() { IWizardFactory::allWizardFactories(); });