work save

This commit is contained in:
Roy Qu 2022-01-02 11:43:23 +08:00
parent 212fdc37b2
commit 69e5e76a6f
3 changed files with 7 additions and 3 deletions

View File

@ -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<int>(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<BreakpointType>(obj["breakpoint_type"].toInt());
addBreakpoint(breakpoint);
}

View File

@ -73,6 +73,7 @@ struct Breakpoint {
QString filename;
QString condition;
bool enabled;
BreakpointType breakpointType;
};
using PBreakpoint = std::shared_ptr<Breakpoint>;

View File

@ -506,7 +506,7 @@
<enum>QTabWidget::South</enum>
</property>
<property name="currentIndex">
<number>6</number>
<number>2</number>
</property>
<property name="iconSize">
<size>
@ -702,7 +702,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="tabDebugConsole">
<attribute name="title">