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:
hjk
2014-10-13 12:49:05 +02:00
parent e43af30faa
commit e279c7e007
35 changed files with 475 additions and 525 deletions

View File

@@ -67,7 +67,7 @@ public:
m_variableList = new QListWidget(q);
m_variableList->setAttribute(Qt::WA_MacSmallSize);
m_variableList->setAttribute(Qt::WA_MacShowFocusRect, false);
foreach (const QByteArray &variable, VariableManager::variables())
foreach (const QByteArray &variable, globalMacroExpander()->variables())
m_variableList->addItem(QString::fromLatin1(variable));
m_variableDescription = new QLabel(q);
@@ -209,8 +209,8 @@ void VariableChooserPrivate::updateDescription(const QString &variable)
if (variable.isNull())
m_variableDescription->setText(m_defaultDescription);
else
m_variableDescription->setText(VariableManager::variableDescription(variable.toUtf8())
+ QLatin1String("<p>") + tr("Current Value: %1").arg(VariableManager::value(variable.toUtf8())));
m_variableDescription->setText(globalMacroExpander()->variableDescription(variable.toUtf8())
+ QLatin1String("<p>") + tr("Current Value: %1").arg(globalMacroExpander()->value(variable.toUtf8())));
}
/*!