Commit c6d4ff53 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Debugger: Fix breakpoint dialog.

Update model once a breakpoint is added, set initial
state of dialog.
parent 6f96d8f1
......@@ -832,9 +832,15 @@ void BreakHandler::appendBreakpoint(const BreakpointParameters &data)
item.data = data;
item.response.fileName = data.fileName;
item.response.lineNumber = data.lineNumber;
const int row = m_storage.size();
beginInsertRows(QModelIndex(), row, row);
m_storage.insert(id, item);
endInsertRows();
updateMarker(id);
scheduleSynchronization();
}
void BreakHandler::saveSessionData()
......
......@@ -100,10 +100,11 @@ private:
Ui::BreakpointDialog m_ui;
BreakpointParameters m_savedParameters;
BreakpointType m_previousType;
bool m_firstTypeChange;
};
BreakpointDialog::BreakpointDialog(QWidget *parent)
: QDialog(parent), m_previousType(UnknownType)
: QDialog(parent), m_previousType(UnknownType), m_firstTypeChange(true)
{
// Match BreakpointType (omitting unknown type).
m_ui.setupUi(this);
......@@ -128,9 +129,10 @@ BreakpointDialog::BreakpointDialog(QWidget *parent)
void BreakpointDialog::setType(BreakpointType type)
{
const int comboIndex = type - 1; // Skip UnknownType.
if (comboIndex != m_ui.comboBoxType->currentIndex()) {
if (comboIndex != m_ui.comboBoxType->currentIndex() || m_firstTypeChange) {
m_ui.comboBoxType->setCurrentIndex(comboIndex);
typeChanged(comboIndex);
m_firstTypeChange = false;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment