Commit c7e8b51d authored by hjk's avatar hjk
Browse files

core: use a class derived from QList<int> instead of a QList<int> for Core::Context

A mostly mechanical change.

Reviewed-By: con
parent a54fc1f6
......@@ -250,7 +250,7 @@ EditorManager *EditorManager::m_instance = 0;
static Command *createSeparator(ActionManager *am, QObject *parent,
const QString &name,
const QList<int> &context)
const Context &context)
{
QAction *tmpaction = new QAction(parent);
tmpaction->setSeparator(true);
......@@ -267,14 +267,15 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
connect(m_d->m_core, SIGNAL(contextAboutToChange(Core::IContext *)),
this, SLOT(handleContextChange(Core::IContext *)));
const QList<int> gc = QList<int>() << Constants::C_GLOBAL_ID;
const QList<int> editManagerContext =
QList<int>() << m_d->m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER);
UniqueIDManager *uidm = m_d->m_core->uniqueIDManager();
const Context gc = Context(Constants::C_GLOBAL_ID);
const Context editManagerContext =
Context(uidm->uniqueIdentifier(Constants::C_EDITORMANAGER));
// combined context for edit & design modes
const QList<int> editDesignContext =
QList<int>() << m_d->m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER)
<< m_d->m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_DESIGN_MODE);
const Context editDesignContext =
Context(uidm->uniqueIdentifier(Constants::C_EDITORMANAGER),
uidm->uniqueIdentifier(Constants::C_DESIGN_MODE));
ActionManager *am = m_d->m_core->actionManager();
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
......
......@@ -39,6 +39,15 @@ QT_END_NAMESPACE
namespace Core {
class CORE_EXPORT Context : public QList<int>
{
public:
Context() {}
explicit Context(int c1) { append(c1); }
Context(int c1, int c2) { append(c1); append(c2); }
Context(int c1, int c2, int c3) { append(c1); append(c2); append(c3); }
};
class CORE_EXPORT IContext : public QObject
{
Q_OBJECT
......@@ -46,7 +55,7 @@ public:
IContext(QObject *parent = 0) : QObject(parent) {}
virtual ~IContext() {}
virtual QList<int> context() const = 0;
virtual Context context() const = 0;
virtual QWidget *widget() = 0;
virtual QString contextHelpId() const { return QString(); }
};
......@@ -54,20 +63,20 @@ public:
class BaseContext : public Core::IContext
{
public:
BaseContext(QWidget *widget, const QList<int> &context, QObject *parent = 0)
BaseContext(QWidget *widget, const Context &context, QObject *parent = 0)
: Core::IContext(parent),
m_widget(widget),
m_context(context)
{
}
QList<int> context() const { return m_context; }
Context context() const { return m_context; }
QWidget *widget() { return m_widget; }
private:
QWidget *m_widget;
QList<int> m_context;
Context m_context;
};
} // namespace Core
......
......@@ -48,6 +48,7 @@ QT_END_NAMESPACE
namespace Core {
class ActionManager;
class Context;
class EditorManager;
class FileManager;
class HelpManager;
......@@ -111,7 +112,7 @@ public:
virtual IContext *currentContextObject() const = 0;
// Adds and removes additional active contexts, these contexts are appended
// to the currently active contexts.
virtual void updateAdditionalContexts(const QList<int> &remove, const QList<int> &add) = 0;
virtual void updateAdditionalContexts(const Context &remove, const Context &add) = 0;
virtual bool hasContext(int context) const = 0;
virtual void addContextObject(IContext *context) = 0;
virtual void removeContextObject(IContext *context) = 0;
......@@ -125,7 +126,7 @@ signals:
void optionsDialogRequested();
void coreAboutToClose();
void contextAboutToChange(Core::IContext *context);
void contextChanged(Core::IContext *context, const QList<int> &additionalContexts);
void contextChanged(Core::IContext *context, const Core::Context &additionalContexts);
};
} // namespace Core
......
......@@ -112,7 +112,7 @@ MainWindow::MainWindow() :
EventFilteringMainWindow(),
m_coreImpl(new CoreImpl(this)),
m_uniqueIDManager(new UniqueIDManager()),
m_globalContext(QList<int>() << Constants::C_GLOBAL_ID),
m_globalContext(Constants::C_GLOBAL_ID),
m_additionalContexts(m_globalContext),
// keep this in sync with main() in app/main.cpp
m_settings(new QSettings(QSettings::IniFormat, QSettings::UserScope,
......@@ -493,7 +493,7 @@ void MainWindow::registerDefaultContainers()
static Command *createSeparator(ActionManager *am, QObject *parent,
const QString &name,
const QList<int> &context)
const Context &context)
{
QAction *tmpaction = new QAction(parent);
tmpaction->setSeparator(true);
......@@ -1196,7 +1196,7 @@ void MainWindow::writeSettings()
m_navigationWidget->saveSettings(m_settings);
}
void MainWindow::updateAdditionalContexts(const QList<int> &remove, const QList<int> &add)
void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add)
{
foreach (const int context, remove) {
if (context == 0)
......@@ -1225,14 +1225,14 @@ bool MainWindow::hasContext(int context) const
void MainWindow::updateContext()
{
QList<int> contexts;
Context contexts;
if (m_activeContext)
contexts += m_activeContext->context();
contexts += m_additionalContexts;
QList<int> uniquecontexts;
Context uniquecontexts;
for (int i = 0; i < contexts.size(); ++i) {
const int c = contexts.at(i);
if (!uniquecontexts.contains(c))
......
......@@ -31,6 +31,7 @@
#define MAINWINDOW_H
#include "core_global.h"
#include "icontext.h"
#include "dialogs/iwizard.h"
#include "eventfilteringmainwindow.h"
......@@ -117,7 +118,7 @@ public:
IContext * currentContextObject() const;
QStatusBar *statusBar() const;
void updateAdditionalContexts(const QList<int> &remove, const QList<int> &add);
void updateAdditionalContexts(const Context &remove, const Context &add);
bool hasContext(int context) const;
void setSuppressNavigationWidget(bool suppress);
......@@ -178,8 +179,8 @@ private:
CoreImpl *m_coreImpl;
UniqueIDManager *m_uniqueIDManager;
QList<int> m_globalContext;
QList<int> m_additionalContexts;
Context m_globalContext;
Context m_additionalContexts;
QSettings *m_settings;
QSettings *m_globalSettings;
SettingsDatabase *m_settingsDatabase;
......
......@@ -57,7 +57,8 @@
namespace Core {
struct ModeManagerPrivate {
struct ModeManagerPrivate
{
explicit ModeManagerPrivate(Internal::MainWindow *mainWindow,
Internal::FancyTabWidget *modeStack,
ModeManager *q);
......@@ -70,7 +71,7 @@ struct ModeManagerPrivate {
QVector<IMode*> m_modes;
QVector<Command*> m_modeShortcuts;
QSignalMapper *m_signalMapper;
QList<int> m_addedContexts;
Context m_addedContexts;
int m_oldCurrent;
};
......@@ -178,7 +179,7 @@ void ModeManager::objectAdded(QObject *obj)
const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->id();
QShortcut *shortcut = new QShortcut(d->m_mainWindow);
shortcut->setWhatsThis(tr("Switch to <b>%1</b> mode").arg(mode->displayName()));
Command *cmd = am->registerShortcut(shortcut, shortcutId, QList<int>() << Constants::C_GLOBAL_ID);
Command *cmd = am->registerShortcut(shortcut, shortcutId, Context(Constants::C_GLOBAL_ID));
d->m_modeShortcuts.insert(index, cmd);
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
......
......@@ -30,6 +30,7 @@
#include "navigationwidget.h"
#include "icore.h"
#include "icontext.h"
#include "coreconstants.h"
#include "inavigationwidgetfactory.h"
#include "modemanager.h"
......@@ -347,8 +348,8 @@ void NavigationWidget::objectAdded(QObject * obj)
ICore *core = ICore::instance();
ActionManager *am = core->actionManager();
QList<int> navicontext = QList<int>() << core->uniqueIDManager()->
uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE);
Context navicontext(core->uniqueIDManager()->
uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE));
QString id = factory->id();
QShortcut *shortcut = new QShortcut(this);
......
......@@ -282,8 +282,7 @@ void OutputPaneManager::init()
{
ActionManager *am = Core::ICore::instance()->actionManager();
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
QList<int> globalcontext;
globalcontext.append(Core::Constants::C_GLOBAL_ID);
Context globalcontext = Context(Core::Constants::C_GLOBAL_ID);
// Window->Output Panes
ActionContainer *mpanes = am->createMenu(Constants::M_WINDOW_PANES);
......@@ -357,7 +356,7 @@ void OutputPaneManager::init()
actionId.remove(QLatin1Char(' '));
QAction *action = new QAction(outPane->displayName(), this);
Command *cmd = am->registerAction(action, actionId, QList<int>() << Constants::C_GLOBAL_ID);
Command *cmd = am->registerAction(action, actionId, Context(Constants::C_GLOBAL_ID));
mpanes->addAction(cmd, "Coreplugin.OutputPane.PanesGroup");
m_actions.insert(cmd->action(), idx);
......
......@@ -80,7 +80,7 @@ QSettings *CorePrototype::settings() const
return callee()->settings();
}
void CorePrototype::updateAdditionalContexts(const QList<int> &remove, const QList<int> &add)
void CorePrototype::updateAdditionalContexts(const Context &remove, const Context &add)
{
callee()->updateAdditionalContexts(remove, add);
}
......
......@@ -46,12 +46,12 @@ class CorePrototype : public QObject, public QScriptable
{
Q_OBJECT
Q_PROPERTY(Core::MessageManager* messageManager READ messageManager DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(Core::FileManager* fileManager READ fileManager DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(Core::EditorManager* editorManager READ editorManager DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(Core::MessageManager *messageManager READ messageManager DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(Core::FileManager *fileManager READ fileManager DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(Core::EditorManager *editorManager READ editorManager DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(QMainWindow* mainWindow READ mainWindow DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(QSettings* settings READ settings DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(QMainWindow *mainWindow READ mainWindow DESIGNABLE false SCRIPTABLE true STORED false)
Q_PROPERTY(QSettings *settings READ settings DESIGNABLE false SCRIPTABLE true STORED false)
public:
typedef Core::ICore ICore;
......@@ -66,7 +66,7 @@ public:
QSettings *settings() const;
public slots:
void updateAdditionalContexts(const QList<int> &remove, const QList<int> &add);
void updateAdditionalContexts(const Context &remove, const Context &add);
QString toString() const;
private:
......
......@@ -36,7 +36,7 @@ using namespace Core;
StatusBarWidget::StatusBarWidget(QObject *parent)
: IContext(parent),
m_widget(0),
m_context(QList<int>()),
m_context(),
m_defaultPosition(StatusBarWidget::First)
{
}
......@@ -46,7 +46,7 @@ StatusBarWidget::~StatusBarWidget()
delete m_widget;
}
QList<int> StatusBarWidget::context() const
Context StatusBarWidget::context() const
{
return m_context;
}
......@@ -68,7 +68,7 @@ QWidget *StatusBarWidget::setWidget(QWidget *widget)
return oldWidget;
}
void StatusBarWidget::setContext(const QList<int> &context)
void StatusBarWidget::setContext(const Context &context)
{
m_context = context;
}
......
......@@ -46,17 +46,17 @@ public:
StatusBarWidget(QObject *parent = 0);
~StatusBarWidget();
QList<int> context() const;
Context context() const;
QWidget *widget();
StatusBarWidget::StatusBarPosition position() const;
QWidget *setWidget(QWidget *widget);
void setContext(const QList<int> &context);
void setContext(const Context &context);
void setPosition(StatusBarWidget::StatusBarPosition position);
private:
QPointer<QWidget> m_widget;
QList<int> m_context;
Context m_context;
StatusBarWidget::StatusBarPosition m_defaultPosition;
};
......
......@@ -83,8 +83,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
Q_UNUSED(error_message)
// Create the globalcontext list to register actions accordingly
QList<int> globalcontext;
globalcontext << UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL);
Core::Context globalcontext(UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL));
// Create the settings Page
m_settings->fromSettings(Core::ICore::instance()->settings());
......
......@@ -1724,7 +1724,7 @@ void CPPEditor::keyPressEvent(QKeyEvent *e)
finishRename();
}
QList<int> CPPEditorEditable::context() const
Core::Context CPPEditorEditable::context() const
{
return m_context;
}
......
......@@ -169,7 +169,7 @@ class CPPEditorEditable : public TextEditor::BaseTextEditorEditable
Q_OBJECT
public:
CPPEditorEditable(CPPEditor *);
QList<int> context() const;
Core::Context context() const;
bool duplicateSupported() const { return true; }
Core::IEditor *duplicate(QWidget *parent);
......@@ -179,7 +179,7 @@ public:
virtual bool open(const QString & fileName);
private:
QList<int> m_context;
Core::Context m_context;
};
class CPPEditor : public TextEditor::BaseTextEditor
......
......@@ -121,10 +121,10 @@ QStringList CppEditorFactory::mimeTypes() const
///////////////////////////////// CppPlugin //////////////////////////////////
static inline
Core::Command *createSeparator(Core::ActionManager *am,
QObject *parent,
const QList<int> &context,
const char *id)
Core::Command *createSeparator(Core::ActionManager *am,
QObject *parent,
Core::Context &context,
const char *id)
{
QAction *separator = new QAction(parent);
separator->setSeparator(true);
......@@ -231,8 +231,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
wizardParameters.setId(QLatin1String("C.Header"));
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));
QList<int> context;
context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR));
Core::ActionManager *am = core->actionManager();
Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT);
......@@ -274,8 +273,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
cppToolsMenu->addAction(cmd);
// Update context in global context
QList<int> globalContext;
globalContext.append(Core::Constants::C_GLOBAL_ID);
Core::Context globalContext(Core::Constants::C_GLOBAL_ID);
cppToolsMenu->addAction(createSeparator(am, this, globalContext, CppEditor::Constants::SEPARATOR2));
m_updateCodeModelAction = new QAction(tr("Update Code Model"), this);
cmd = am->registerAction(m_updateCodeModelAction, QLatin1String(Constants::UPDATE_CODEMODEL), globalContext);
......
......@@ -132,7 +132,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
// Actions
m_context = core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
QList<int> context = QList<int>() << m_context;
Core::Context context(m_context);
QAction *switchAction = new QAction(tr("Switch Header/Source"), this);
Core::Command *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context);
......
......@@ -204,8 +204,8 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
static inline Core::Command *createSeparator(QObject *parent,
Core::ActionManager *ami,
const char*id,
const QList<int> &globalcontext)
const char *id,
const Core::Context &globalcontext)
{
QAction *tmpaction = new QAction(parent);
tmpaction->setSeparator(true);
......@@ -257,8 +257,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
toolsContainer->addMenu(cvsMenu);
m_menuAction = cvsMenu->menu()->menuAction();
QList<int> globalcontext;
globalcontext << core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL);
Core::Context globalcontext(core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL));
Core::Command *command;
......@@ -380,7 +379,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
m_commandLocator->appendCommand(command);
// Actions of the submit editor
QList<int> cvscommitcontext;
Core::Context cvscommitcontext;
cvscommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::CVSCOMMITEDITOR);
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
......
......@@ -72,6 +72,7 @@
#include <coreplugin/dialogs/ioptionspage.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/findplaceholder.h>
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
#include <coreplugin/icorelistener.h>
#include <coreplugin/manhattanstyle.h>
......@@ -877,7 +878,7 @@ public:
QString m_previousMode;
TextEditor::BaseTextMark *m_locationMark;
int m_gdbRunningContext;
Core::Context m_gdbRunningContext;
AttachRemoteParameters m_attachRemoteParameters;
QAction *m_startExternalAction;
......@@ -968,7 +969,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
m_sessionEngine = 0;
m_debugMode = 0;
m_locationMark = 0;
m_gdbRunningContext = 0;
m_gdbRunningContext = Core::Context(0);
m_debugMode = 0;
m_uiSwitcher = 0;
......@@ -987,20 +988,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
Core::ActionManager *am = core->actionManager();
QTC_ASSERT(am, return false);
const QList<int> globalcontext = QList<int>()
<< CC::C_GLOBAL_ID;
const QList<int> cppcontext = QList<int>()
<< uidm->uniqueIdentifier(PE::LANG_CXX);
const QList<int> cppDebuggercontext = QList<int>()
<< uidm->uniqueIdentifier(C_CPPDEBUGGER);
const QList<int> cppeditorcontext = QList<int>()
<< uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
const QList<int> texteditorcontext = QList<int>()
<< uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
const Core::Context globalcontext(CC::C_GLOBAL_ID);
const Core::Context cppDebuggercontext(uidm->uniqueIdentifier(C_CPPDEBUGGER));
const Core::Context cppeditorcontext(uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR));
m_stopIcon = QIcon(_(":/debugger/images/debugger_stop_small.png"));
m_stopIcon.addFile(":/debugger/images/debugger_stop.png");
......@@ -1218,18 +1208,17 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
errorMessage->clear();
}
m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING);
m_gdbRunningContext = Core::Context(uidm->uniqueIdentifier(Constants::GDBRUNNING));
// Register factory of DebuggerRunControl.
m_debuggerRunControlFactory = new DebuggerRunControlFactory
(m_plugin, DebuggerEngineType(cmdLineEnabledEngines));
m_plugin->addAutoReleasedObject(m_debuggerRunControlFactory);
QList<int> context;
context.append(uidm->uniqueIdentifier(CC::C_EDITORMANAGER));
context.append(uidm->uniqueIdentifier(C_DEBUGMODE));
context.append(uidm->uniqueIdentifier(CC::C_NAVIGATION_PANE));
m_debugMode->setContext(context);
m_debugMode->setContext(Core::Context(
uidm->uniqueIdentifier(CC::C_EDITORMANAGER),
uidm->uniqueIdentifier(C_DEBUGMODE),
uidm->uniqueIdentifier(CC::C_NAVIGATION_PANE)));
m_reverseToolButton = 0;
......@@ -1271,7 +1260,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
am->actionContainer(PE::M_DEBUG_STARTDEBUGGING);
cmd = am->registerAction(m_actions.continueAction,
PE::DEBUG, QList<int>() << m_gdbRunningContext);
PE::DEBUG, m_gdbRunningContext);
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
cmd = am->registerAction(m_startExternalAction,
......@@ -2096,9 +2085,9 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
const bool startIsContinue = (m_state == InferiorStopped);
ICore *core = ICore::instance();
if (startIsContinue)
core->updateAdditionalContexts(QList<int>(), QList<int>() << m_gdbRunningContext);
core->updateAdditionalContexts(Core::Context(), m_gdbRunningContext);
else
core->updateAdditionalContexts(QList<int>() << m_gdbRunningContext, QList<int>());
core->updateAdditionalContexts(m_gdbRunningContext, Core::Context());
const bool started = m_state == InferiorRunning
|| m_state == InferiorRunningRequested
......
......@@ -87,9 +87,9 @@ struct DebuggerUISwitcherPrivate
Internal::DebuggerMainWindow *m_mainWindow;
// global context
QList<int> m_globalContext;
Core::Context m_globalContext;
QHash<int, QList<int> > m_contextsForLanguage;
QHash<int, Core::Context> m_contextsForLanguage;
QActionGroup *m_languageActionGroup;
......@@ -213,9 +213,7 @@ void DebuggerUISwitcher::createViewsMenuItems()
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
QList<int> globalcontext;
globalcontext << Core::Constants::C_GLOBAL_ID;
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
QMenu *mLang = d->m_languageMenu->menu();
mLang->setTitle(tr("&Languages"));
......@@ -237,7 +235,7 @@ DebuggerUISwitcher *DebuggerUISwitcher::instance()
return DebuggerUISwitcherPrivate::m_instance;
}
void DebuggerUISwitcher::addLanguage(const QString &langName, const QList<int> &context)
void DebuggerUISwitcher::addLanguage(const QString &langName, const Core::Context &context)
{
//qDebug() << "ADD UI LANGUAGE: " << langName;
d->m_toolBars.insert(langName, 0);
......@@ -310,8 +308,8 @@ void DebuggerUISwitcher::changeDebuggerUI(const QString &langName)
QHashIterator<int, Core::Command *> iter(d->m_menuCommands);
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);
const Core::Context &oldContexts = d->m_contextsForLanguage.value(d->m_activeLanguage);
const Core::Context &newContexts = d->m_contextsForLanguage.value(langId);
core->updateAdditionalContexts(oldContexts, newContexts);
d->m_activeLanguage = langId;
......@@ -401,7 +399,7 @@ QDockWidget *DebuggerUISwitcher::createDockWidget(const QString &langName,
if (d->m_languages.indexOf(langName) != d->m_activeLanguage)
dockWidget->hide();
QList<int> langContext = d->m_contextsForLanguage.value(d->m_languages.indexOf(langName));
Core::Context langContext = d->m_contextsForLanguage.value(d->m_languages.indexOf(langName));