Variables: Use lambdas as callbacks to resolve variables

Instead of broadcasting for each resolution we ask the code
that knows about a specific variable directly.

Change-Id: I2f0f4f2acceba85a236995d236980594a3166bd8
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
hjk
2014-06-23 16:57:56 +02:00
parent 000fbe63bc
commit 2982a763ac
15 changed files with 292 additions and 414 deletions

View File

@@ -175,10 +175,10 @@ public:
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
SLOT(reloadDisassembly()));
VariableManager::registerFileVariables(PrefixDebugExecutable,
tr("Debugged executable"));
connect(VariableManager::instance(), SIGNAL(variableUpdateRequested(QByteArray)),
SLOT(updateVariable(QByteArray)));
tr("Debugged executable"),
[&]() { return this->m_startParameters.executable; });
}
public slots:
@@ -190,13 +190,6 @@ public slots:
void doInterruptInferior();
void doFinishDebugger();
void updateVariable(const QByteArray &variable)
{
if (VariableManager::isFileVariable(variable, PrefixDebugExecutable))
VariableManager::insert(variable,
VariableManager::fileVariableValue(variable, PrefixDebugExecutable, m_startParameters.executable));
}
void reloadDisassembly()
{
m_disassemblerAgent.reload();