Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/debugcontroller.cpp
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Line(s) | 189 | { | |||
---|---|---|---|---|---|
268 | ac->addAction(QStringLiteral("debug_stepout"), action); | 268 | ac->addAction(QStringLiteral("debug_stepout"), action); | ||
269 | 269 | | |||
270 | m_toggleBreakpoint = action = new QAction(QIcon::fromTheme(QStringLiteral("breakpoint")), i18n("Toggle Breakpoint"), this); | 270 | m_toggleBreakpoint = action = new QAction(QIcon::fromTheme(QStringLiteral("breakpoint")), i18n("Toggle Breakpoint"), this); | ||
271 | ac->setDefaultShortcut( action, i18n("Ctrl+Alt+B") ); | 271 | ac->setDefaultShortcut( action, i18n("Ctrl+Alt+B") ); | ||
272 | action->setToolTip(i18n("Toggle breakpoint")); | 272 | action->setToolTip(i18n("Toggle breakpoint")); | ||
273 | action->setWhatsThis(i18n("Toggles the breakpoint at the current line in editor.")); | 273 | action->setWhatsThis(i18n("Toggles the breakpoint at the current line in editor.")); | ||
274 | connect(action, &QAction::triggered, this, &DebugController::toggleBreakpoint); | 274 | connect(action, &QAction::triggered, this, &DebugController::toggleBreakpoint); | ||
275 | ac->addAction(QStringLiteral("debug_toggle_breakpoint"), action); | 275 | ac->addAction(QStringLiteral("debug_toggle_breakpoint"), action); | ||
276 | | ||||
277 | m_showCurrentLine = action = new QAction(QIcon::fromTheme(QStringLiteral("go-jump")), i18n("Show Current Line"), this); | ||||
278 | action->setToolTip(i18n("Show the current execution position")); | ||||
279 | action->setWhatsThis(i18n("Jumps to the execution line in the editor.")); | ||||
280 | connect(action, &QAction::triggered, this, &DebugController::showCurrentLine); | ||||
281 | ac->addAction(QStringLiteral("debug_showcurrentline"), action); | ||||
276 | } | 282 | } | ||
277 | 283 | | |||
278 | void DebugController::addSession(IDebugSession* session) | 284 | void DebugController::addSession(IDebugSession* session) | ||
279 | { | 285 | { | ||
280 | qCDebug(SHELL) << session; | 286 | qCDebug(SHELL) << session; | ||
281 | Q_ASSERT(session->variableController()); | 287 | Q_ASSERT(session->variableController()); | ||
282 | Q_ASSERT(session->breakpointController()); | 288 | Q_ASSERT(session->breakpointController()); | ||
283 | Q_ASSERT(session->frameStackModel()); | 289 | Q_ASSERT(session->frameStackModel()); | ||
▲ Show 20 Lines • Show All 257 Lines • ▼ Show 20 Line(s) | |||||
541 | { | 547 | { | ||
542 | if (KDevelop::IDocument* document = KDevelop::ICore::self()->documentController()->activeDocument()) { | 548 | if (KDevelop::IDocument* document = KDevelop::ICore::self()->documentController()->activeDocument()) { | ||
543 | KTextEditor::Cursor cursor = document->cursorPosition(); | 549 | KTextEditor::Cursor cursor = document->cursorPosition(); | ||
544 | if (!cursor.isValid()) return; | 550 | if (!cursor.isValid()) return; | ||
545 | breakpointModel()->toggleBreakpoint(document->url(), cursor); | 551 | breakpointModel()->toggleBreakpoint(document->url(), cursor); | ||
546 | } | 552 | } | ||
547 | } | 553 | } | ||
548 | 554 | | |||
555 | void DebugController::showCurrentLine() | ||||
556 | { | ||||
557 | const auto location = qMakePair(m_currentSession->currentUrl(), m_currentSession->currentLine()); | ||||
kossebau: const auto location, please | |||||
558 | | ||||
559 | if (location.second != -1) { | ||||
kossebau: { on same line as the if, please | |||||
560 | const auto localLocation = m_currentSession->convertToLocalUrl(location); | ||||
561 | ICore::self()->documentController()->openDocument(localLocation.first, | ||||
kossebau: const auto localLocation, please (auto for consistency with above) | |||||
562 | KTextEditor::Cursor(localLocation.second, 0), | ||||
563 | IDocumentController::DefaultMode); | ||||
564 | } | ||||
565 | | ||||
566 | } | ||||
567 | | ||||
549 | const QPixmap* DebugController::executionPointPixmap() | 568 | const QPixmap* DebugController::executionPointPixmap() | ||
550 | { | 569 | { | ||
551 | static QPixmap pixmap=QIcon::fromTheme(QStringLiteral("go-next")).pixmap(QSize(22,22), QIcon::Normal, QIcon::Off); | 570 | static QPixmap pixmap=QIcon::fromTheme(QStringLiteral("go-next")).pixmap(QSize(22,22), QIcon::Normal, QIcon::Off); | ||
552 | return &pixmap; | 571 | return &pixmap; | ||
553 | } | 572 | } | ||
554 | 573 | | |||
555 | } | 574 | } |
const auto location, please