From 69e5e76a6f12f37a2a49abf2fade0f9fc791ddac Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 2 Jan 2022 11:43:23 +0800 Subject: [PATCH] work save --- RedPandaIDE/debugger.cpp | 5 ++++- RedPandaIDE/debugger.h | 1 + RedPandaIDE/mainwindow.ui | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index 5dfefb86..e607aa63 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -261,6 +261,7 @@ void Debugger::addBreakpoint(int line, const QString &filename) bp->filename = filename; bp->condition = ""; bp->enabled = true; + bp->breakpointType = BreakpointType::Breakpoint; mBreakpointModel->addBreakpoint(bp); if (mExecuting) { sendBreakpointCommand(bp); @@ -1463,7 +1464,7 @@ QVariant BreakpointModel::headerData(int section, Qt::Orientation orientation, i if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { switch(section) { case 0: - return tr("Filename"); + return tr("Type"); case 1: return tr("Line"); case 2: @@ -1533,6 +1534,7 @@ void BreakpointModel::save(const QString &filename) obj["line"]=breakpoint->line; obj["condition"]=breakpoint->condition; obj["enabled"]=breakpoint->enabled; + obj["breakpoint_type"] = static_cast(breakpoint->breakpointType); array.append(obj); } QJsonDocument doc; @@ -1572,6 +1574,7 @@ void BreakpointModel::load(const QString &filename) breakpoint->line = obj["line"].toInt(); breakpoint->condition = obj["condition"].toString(); breakpoint->enabled = obj["enabled"].toBool(); + breakpoint->breakpointType = static_cast(obj["breakpoint_type"].toInt()); addBreakpoint(breakpoint); } diff --git a/RedPandaIDE/debugger.h b/RedPandaIDE/debugger.h index 34be6909..ba85cde0 100644 --- a/RedPandaIDE/debugger.h +++ b/RedPandaIDE/debugger.h @@ -73,6 +73,7 @@ struct Breakpoint { QString filename; QString condition; bool enabled; + BreakpointType breakpointType; }; using PBreakpoint = std::shared_ptr; diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index c0ab77b7..9e9b4b25 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -506,7 +506,7 @@ QTabWidget::South - 6 + 2 @@ -702,7 +702,7 @@ QTabWidget::North - 0 + 2