Work with documents instead of editors where possible in debugger

And where using editors is necessary, take *all* editors into account,
not a random set of what previously was called "original" editors (when
using splits).

Change-Id: Id6bbad08f3083b6744fc2edcf0b87ba504d3257b
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Eike Ziller
2013-07-09 12:14:33 +02:00
parent 354cd410b0
commit 871a8cd031
9 changed files with 58 additions and 77 deletions

View File

@@ -582,20 +582,13 @@ void DebuggerEngine::gotoLocation(const Location &loc)
const QString file = loc.fileName();
const int line = loc.lineNumber();
QList<IEditor *> editors = EditorManager::instance()->editorsForFileName(file);
IEditor *editor = 0;
if (editors.isEmpty()) {
editor = EditorManager::openEditor(file, Core::Id(),
EditorManager::IgnoreNavigationHistory);
QTC_ASSERT(editor, return); // Unreadable file?
editor->setProperty(Constants::OPENED_BY_DEBUGGER, true);
} else {
editor = editors.back();
}
ITextEditor *texteditor = qobject_cast<ITextEditor *>(editor);
if (texteditor)
texteditor->gotoLine(line, 0);
bool newEditor = false;
IEditor *editor = EditorManager::openEditor(file, Core::Id(),
EditorManager::IgnoreNavigationHistory, &newEditor);
QTC_ASSERT(editor, return); // Unreadable file?
editor->gotoLine(line, 0);
if (newEditor)
editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true);
if (loc.needsMarker()) {
d->m_locationMark.reset(new TextEditor::BaseTextMark(file, line));
@@ -604,9 +597,6 @@ void DebuggerEngine::gotoLocation(const Location &loc)
d->m_locationMark->init();
}
// FIXME: Breaks with split views.
if (!d->m_memoryAgent.hasVisibleEditor() || loc.needsRaise())
EditorManager::activateEditor(editor);
//qDebug() << "MEMORY: " << d->m_memoryAgent.hasVisibleEditor();
}