diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index b31a5d131b5..93c1f4c1d28 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1413,13 +1413,8 @@ Core::Id EditorManager::getOpenWithEditorId(const QString &fileName, IEditor *EditorManager::openEditor(const QString &fileName, const Id &editorId, OpenEditorFlags flags, bool *newEditor) { - return m_instance->openEditor(m_instance->currentEditorView(), - fileName, editorId, flags, newEditor); -} - -IEditor *EditorManager::openEditorInOtherSplit(const QString &fileName, const Id &editorId, OpenEditorFlags flags, bool *newEditor) -{ - m_instance->gotoOtherSplit(); + if (flags & EditorManager::OpenInOtherSplit) + m_instance->gotoOtherSplit(); return m_instance->openEditor(m_instance->currentEditorView(), fileName, editorId, flags, newEditor); } diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index 74297304602..e0d2ba6026b 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -110,15 +110,14 @@ public: NoActivate = 1, IgnoreNavigationHistory = 2, ModeSwitch = 4, - CanContainLineNumber = 8 + CanContainLineNumber = 8, + OpenInOtherSplit = 16 }; Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag) static QString splitLineNumber(QString *fileName); static IEditor *openEditor(const QString &fileName, const Id &editorId = Id(), OpenEditorFlags flags = 0, bool *newEditor = 0); - static IEditor *openEditorInOtherSplit(const QString &fileName, const Id &editorId = Id(), - OpenEditorFlags flags = 0, bool *newEditor = 0); static IEditor *openEditorWithContents(const Id &editorId, QString *titlePattern = 0, const QString &contents = QString()); diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 66e8a689660..af579bb5a7e 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -164,7 +164,8 @@ void CppToolsPlugin::switchHeaderSourceInNextSplit() QString otherFile = correspondingHeaderOrSource( Core::EditorManager::currentEditor()->document()->fileName()); if (!otherFile.isEmpty()) - Core::EditorManager::openEditorInOtherSplit(otherFile); + Core::EditorManager::openEditor(otherFile, Core::Id(), Core::EditorManager::OpenInOtherSplit + | Core::EditorManager::ModeSwitch); } static QStringList findFilesInProject(const QString &name,