forked from qt-creator/qt-creator
		
	Debugger: Fix breakpoint dialog.
Update model once a breakpoint is added, set initial state of dialog.
This commit is contained in:
		@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user