forked from qt-creator/qt-creator
Move openEditorAt from BaseTextEditorWidget to EditorManager
More sensible place, gotoLine is a method in IEditor anyhow. Change-Id: I420a6bf17060c16e6f1a4f45e0bef89379fb6bf8 Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -1419,6 +1419,19 @@ IEditor *EditorManager::openEditor(const QString &fileName, const Id &editorId,
|
||||
fileName, editorId, flags, newEditor);
|
||||
}
|
||||
|
||||
IEditor *EditorManager::openEditorAt(const QString &fileName, int line, int column,
|
||||
const Id &editorId, OpenEditorFlags flags, bool *newEditor)
|
||||
{
|
||||
m_instance->cutForwardNavigationHistory();
|
||||
m_instance->addCurrentPositionToNavigationHistory();
|
||||
OpenEditorFlags tempFlags = flags | IgnoreNavigationHistory;
|
||||
Core::IEditor *editor = Core::EditorManager::openEditor(fileName, editorId,
|
||||
tempFlags, newEditor);
|
||||
if (editor && line != -1)
|
||||
editor->gotoLine(line, column);
|
||||
return editor;
|
||||
}
|
||||
|
||||
static int extractLineNumber(QString *fileName)
|
||||
{
|
||||
int i = fileName->length() - 1;
|
||||
|
||||
@@ -118,6 +118,9 @@ public:
|
||||
static QString splitLineNumber(QString *fileName);
|
||||
static IEditor *openEditor(const QString &fileName, const Id &editorId = Id(),
|
||||
OpenEditorFlags flags = 0, bool *newEditor = 0);
|
||||
static IEditor *openEditorAt(const QString &fileName, int line, int column = 0,
|
||||
const Id &editorId = Id(), OpenEditorFlags flags = 0,
|
||||
bool *newEditor = 0);
|
||||
static IEditor *openEditorWithContents(const Id &editorId,
|
||||
QString *titlePattern = 0, const QString &contents = QString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user