forked from qt-creator/qt-creator
Make 'open in other split' a flag instead of another method.
Change-Id: I1acafd85ec7a87ba2ac61240f30c329d56461118 Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -1413,12 +1413,7 @@ Core::Id EditorManager::getOpenWithEditorId(const QString &fileName,
|
|||||||
IEditor *EditorManager::openEditor(const QString &fileName, const Id &editorId,
|
IEditor *EditorManager::openEditor(const QString &fileName, const Id &editorId,
|
||||||
OpenEditorFlags flags, bool *newEditor)
|
OpenEditorFlags flags, bool *newEditor)
|
||||||
{
|
{
|
||||||
return m_instance->openEditor(m_instance->currentEditorView(),
|
if (flags & EditorManager::OpenInOtherSplit)
|
||||||
fileName, editorId, flags, newEditor);
|
|
||||||
}
|
|
||||||
|
|
||||||
IEditor *EditorManager::openEditorInOtherSplit(const QString &fileName, const Id &editorId, OpenEditorFlags flags, bool *newEditor)
|
|
||||||
{
|
|
||||||
m_instance->gotoOtherSplit();
|
m_instance->gotoOtherSplit();
|
||||||
return m_instance->openEditor(m_instance->currentEditorView(),
|
return m_instance->openEditor(m_instance->currentEditorView(),
|
||||||
fileName, editorId, flags, newEditor);
|
fileName, editorId, flags, newEditor);
|
||||||
|
|||||||
@@ -110,15 +110,14 @@ public:
|
|||||||
NoActivate = 1,
|
NoActivate = 1,
|
||||||
IgnoreNavigationHistory = 2,
|
IgnoreNavigationHistory = 2,
|
||||||
ModeSwitch = 4,
|
ModeSwitch = 4,
|
||||||
CanContainLineNumber = 8
|
CanContainLineNumber = 8,
|
||||||
|
OpenInOtherSplit = 16
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)
|
Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)
|
||||||
|
|
||||||
static QString splitLineNumber(QString *fileName);
|
static QString splitLineNumber(QString *fileName);
|
||||||
static IEditor *openEditor(const QString &fileName, const Id &editorId = Id(),
|
static IEditor *openEditor(const QString &fileName, const Id &editorId = Id(),
|
||||||
OpenEditorFlags flags = 0, bool *newEditor = 0);
|
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,
|
static IEditor *openEditorWithContents(const Id &editorId,
|
||||||
QString *titlePattern = 0, const QString &contents = QString());
|
QString *titlePattern = 0, const QString &contents = QString());
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,8 @@ void CppToolsPlugin::switchHeaderSourceInNextSplit()
|
|||||||
QString otherFile = correspondingHeaderOrSource(
|
QString otherFile = correspondingHeaderOrSource(
|
||||||
Core::EditorManager::currentEditor()->document()->fileName());
|
Core::EditorManager::currentEditor()->document()->fileName());
|
||||||
if (!otherFile.isEmpty())
|
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,
|
static QStringList findFilesInProject(const QString &name,
|
||||||
|
|||||||
Reference in New Issue
Block a user