forked from qt-creator/qt-creator
Fixed auto-switching issues with QML inspector and c++ debugger
Reviewed-by: hjk
This commit is contained in:
@@ -1340,6 +1340,16 @@ void DebuggerPlugin::readSettings()
|
||||
DebuggerSettings::instance()->readSettings(s);
|
||||
}
|
||||
|
||||
static bool isCurrentProjectCppBased()
|
||||
{
|
||||
ProjectExplorer::ProjectExplorerPlugin *projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance();
|
||||
Project *startupProject = projectExplorer->startupProject();
|
||||
const QStringList cppProjectIds = QStringList() << QLatin1String("GenericProjectManager.GenericProject")
|
||||
<< QLatin1String("CMakeProjectManager.CMakeProject")
|
||||
<< QLatin1String("Qt4ProjectManager.Qt4Project");
|
||||
return (startupProject && cppProjectIds.contains(startupProject->id()));
|
||||
}
|
||||
|
||||
void DebuggerPlugin::onModeChanged(IMode *mode)
|
||||
{
|
||||
// FIXME: This one gets always called, even if switching between modes
|
||||
@@ -1353,12 +1363,14 @@ void DebuggerPlugin::onModeChanged(IMode *mode)
|
||||
if (editorManager->currentEditor()) {
|
||||
editorManager->currentEditor()->widget()->setFocus();
|
||||
|
||||
if (editorManager->currentEditor()->id() == CppEditor::Constants::C_CPPEDITOR)
|
||||
if (isCurrentProjectCppBased())
|
||||
m_uiSwitcher->setActiveLanguage(LANG_CPP);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DebuggerPlugin::showSettingsDialog()
|
||||
{
|
||||
Core::ICore::instance()->showOptionsDialog(
|
||||
|
||||
Reference in New Issue
Block a user