From a795c6932585816d73e26369b6431e7722b382ee Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Fri, 9 Apr 2010 16:10:06 +0200 Subject: [PATCH] debugger: more breakpoint refactoring --- src/plugins/debugger/breakhandler.cpp | 11 ----------- src/plugins/debugger/breakhandler.h | 1 - src/plugins/debugger/debuggermanager.cpp | 13 ++++++++++++- src/plugins/debugger/debuggermanager.h | 1 + src/plugins/debugger/debuggerplugin.cpp | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index d6822717628..6ed2830cd8c 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -746,17 +746,6 @@ void BreakHandler::loadSessionData() updateMarkers(); } -void BreakHandler::activateBreakpoint(int index) -{ - const BreakpointData *data = at(index); - if (!data->markerFileName().isEmpty()) { - StackFrame frame; - frame.file = data->markerFileName(); - frame.line = data->markerLineNumber(); - m_manager->gotoLocation(frame, false); - } -} - void BreakHandler::breakByFunction(const QString &functionName) { // One breakpoint per function is enough for now. This does not handle diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 35904fbaf67..c0aaadc8cb6 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -160,7 +160,6 @@ public slots: void appendBreakpoint(BreakpointData *data); void toggleBreakpointEnabled(BreakpointData *data); void breakByFunction(const QString &functionName); - void activateBreakpoint(int index); void removeBreakpoint(int index); private: diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 08c7fd06287..ba2c527fd19 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -419,7 +419,7 @@ void DebuggerManager::init() qobject_cast<QAbstractItemView *>(d->m_breakWindow); breakView->setModel(d->m_breakHandler->model()); connect(breakView, SIGNAL(breakpointActivated(int)), - d->m_breakHandler, SLOT(activateBreakpoint(int))); + this, SLOT(activateBreakpoint(int))); connect(breakView, SIGNAL(breakpointDeleted(int)), d->m_breakHandler, SLOT(removeBreakpoint(int))); connect(breakView, SIGNAL(breakpointSynchronizationRequested()), @@ -1336,6 +1336,17 @@ void DebuggerManager::addToWatchWindow() d->m_watchHandler->watchExpression(exp); } +void DebuggerManager::activateBreakpoint(int index) +{ + const BreakpointData *data = breakHandler()->at(index); + if (!data->markerFileName().isEmpty()) { + StackFrame frame; + frame.file = data->markerFileName(); + frame.line = data->markerLineNumber(); + gotoLocation(frame, false); + } +} + void DebuggerManager::breakByFunctionMain() { #ifdef Q_OS_WIN diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index 6f3fbfece89..4e4657a748d 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -259,6 +259,7 @@ public slots: // FIXME { showDebuggerOutput(LogDebug, msg); } void ensureLogVisible(); void updateWatchersWindow(); + void activateBreakpoint(int index); //private slots: // FIXME void showDebuggerOutput(int channel, const QString &msg); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 769448f0038..13c2add30da 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1174,11 +1174,11 @@ void DebuggerPlugin::requestContextMenu(TextEditor::ITextEditor *editor, void DebuggerPlugin::breakpointSetRemoveMarginActionTriggered() { - if (QAction *act = qobject_cast<QAction *>(sender())) { - QString str = act->data().toString(); - int pos = str.lastIndexOf(':'); - m_manager->toggleBreakpoint(str.left(pos), str.mid(pos + 1).toInt()); - } + QAction *act = qobject_cast<QAction *>(sender()); + QTC_ASSERT(act, return); + QString str = act->data().toString(); + int pos = str.lastIndexOf(':'); + m_manager->toggleBreakpoint(str.left(pos), str.mid(pos + 1).toInt()); } void DebuggerPlugin::breakpointEnableDisableMarginActionTriggered() -- GitLab