aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggerplugin.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2014-06-24 10:02:54 +0200
committerhjk <[email protected]>2014-06-24 18:59:17 +0200
commit4572021a8d3c841de1ec240e4663854abef6bc9a (patch)
tree5de3ab3f45bdea4a7fcc301da758b3e351604a41 /src/plugins/debugger/debuggerplugin.cpp
parenta980ea98bb0eb507c2e5df6b98a51b321b2bec74 (diff)
TextEditor: Consolidate various currentTextEditor() implementations
Change-Id: Ie61c985e31a76dfd34ec1db207753007cee9aff3 Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index e966ebd7e77..59c018f2796 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -695,14 +695,9 @@ bool fillParameters(DebuggerStartParameters *sp, const Kit *kit, QString *errorM
return true;
}
-static TextEditor::ITextEditor *currentTextEditor()
-{
- return qobject_cast<TextEditor::ITextEditor *>(EditorManager::currentEditor());
-}
-
static bool currentTextEditorPosition(ContextData *data)
{
- TextEditor::ITextEditor *textEditor = currentTextEditor();
+ ITextEditor *textEditor = ITextEditor::currentTextEditor();
if (!textEditor)
return false;
const IDocument *document = textEditor->document();
@@ -1069,7 +1064,7 @@ public slots:
void handleExecRunToSelectedFunction()
{
- ITextEditor *textEditor = currentTextEditor();
+ ITextEditor *textEditor = ITextEditor::currentTextEditor();
QTC_ASSERT(textEditor, return);
QPlainTextEdit *ed = qobject_cast<QPlainTextEdit*>(textEditor->widget());
if (!ed)
@@ -2047,7 +2042,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
void DebuggerPluginPrivate::toggleBreakpoint()
{
- ITextEditor *textEditor = currentTextEditor();
+ ITextEditor *textEditor = ITextEditor::currentTextEditor();
QTC_ASSERT(textEditor, return);
const int lineNumber = textEditor->currentLine();
if (textEditor->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {