debugger: use ITextEditor in DebuggerManager

The dependency was there for a while. No need to jump through hoops hoping
to maintain a stand-alone debugger anymore.
This commit is contained in:
hjk
2010-03-10 13:58:20 +01:00
parent 8f438da57b
commit e6be08b388
3 changed files with 32 additions and 41 deletions

View File

@@ -1033,20 +1033,13 @@ void DebuggerPlugin::activateDebugMode()
modeManager->activateMode(QLatin1String(MODE_DEBUG));
}
QWidget *DebuggerPlugin::currentTextEditor(QString *fileName, int *lineNumber)
TextEditor::ITextEditor *DebuggerPlugin::currentTextEditor()
{
EditorManager *editorManager = EditorManager::instance();
if (!editorManager)
return 0;
Core::IEditor *editor = editorManager->currentEditor();
ITextEditor *textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
return 0;
if (fileName)
*fileName = textEditor->file()->fileName();
if (lineNumber)
*lineNumber = textEditor->currentLine();
return textEditor->widget();
return qobject_cast<ITextEditor*>(editor);
}
void DebuggerPlugin::editorOpened(Core::IEditor *editor)