Commit 97915bbc authored by Eike Ziller's avatar Eike Ziller
Browse files

Make 'open in other split' a flag instead of another method.



Change-Id: I1acafd85ec7a87ba2ac61240f30c329d56461118
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 55e087ab
......@@ -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);
}
......
......@@ -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());
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment