forked from qt-creator/qt-creator
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:
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/editormanager/documentmodel.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
|
||||
#include <utils/tooltip/tooltip.h>
|
||||
@@ -1372,7 +1373,8 @@ void DebuggerToolTipManager::debugModeEntered()
|
||||
this, SLOT(slotUpdateVisibleToolTips()));
|
||||
connect(em, SIGNAL(editorOpened(Core::IEditor*)),
|
||||
this, SLOT(slotEditorOpened(Core::IEditor*)));
|
||||
foreach (IEditor *e, em->openedEditors())
|
||||
DocumentModel *documentModel = EditorManager::documentModel();
|
||||
foreach (IEditor *e, documentModel->editorsForDocuments(documentModel->openedDocuments()))
|
||||
slotEditorOpened(e);
|
||||
// Position tooltips delayed once all the editor placeholder layouting is done.
|
||||
if (!m_tooltips.isEmpty())
|
||||
@@ -1391,15 +1393,14 @@ void DebuggerToolTipManager::leavingDebugMode()
|
||||
hide();
|
||||
if (QWidget *topLevel = ICore::mainWindow()->topLevelWidget())
|
||||
topLevel->removeEventFilter(this);
|
||||
if (EditorManager *em = EditorManager::instance()) {
|
||||
foreach (IEditor *e, em->openedEditors()) {
|
||||
if (DebuggerToolTipEditor toolTipEditor = DebuggerToolTipEditor(e)) {
|
||||
toolTipEditor.baseTextEditor->verticalScrollBar()->disconnect(this);
|
||||
toolTipEditor.textEditor->disconnect(this);
|
||||
}
|
||||
DocumentModel *documentModel = EditorManager::documentModel();
|
||||
foreach (IEditor *e, documentModel->editorsForDocuments(documentModel->openedDocuments())) {
|
||||
if (DebuggerToolTipEditor toolTipEditor = DebuggerToolTipEditor(e)) {
|
||||
toolTipEditor.baseTextEditor->verticalScrollBar()->disconnect(this);
|
||||
toolTipEditor.textEditor->disconnect(this);
|
||||
}
|
||||
em->disconnect(this);
|
||||
}
|
||||
EditorManager::instance()->disconnect(this);
|
||||
m_lastToolTipEditor = 0;
|
||||
m_lastToolTipPoint = QPoint(-1, -1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user