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:
Eike Ziller
2013-05-30 17:26:51 +02:00
parent 97ce8e4098
commit 2125525e77
25 changed files with 84 additions and 98 deletions

View File

@@ -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;

View File

@@ -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());