forked from qt-creator/qt-creator
Introduced a single convenient function for updating additional contexts
While before you had to call add, then remove for each context id and then call update, now you call updateAdditionalContexts with a list of contexts to remove and add. It has the update step built in. Reviewed-by: con
This commit is contained in:
@@ -317,13 +317,7 @@ void DebuggerUISwitcher::changeDebuggerUI(const QString &langName)
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
const QList<int> &oldContexts = d->m_contextsForLanguage.value(d->m_activeLanguage);
|
||||
const QList<int> &newContexts = d->m_contextsForLanguage.value(langId);
|
||||
foreach(int ctx, oldContexts)
|
||||
core->removeAdditionalContext(ctx);
|
||||
|
||||
foreach(int ctx, newContexts)
|
||||
core->addAdditionalContext(ctx);
|
||||
|
||||
core->updateContext();
|
||||
core->updateAdditionalContexts(oldContexts, newContexts);
|
||||
|
||||
d->m_activeLanguage = langId;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user