Debugger: Improve gdb binary settings handling.

- Remove non-executable entries  on reading (check only
  absolute paths since path search is too expensive).
- Make sure gdb binary settings are not written out unless the
  user really changes them.

Reviewed-by: aep <arvid.picciani@nokia.com>
Acked-By: hjk
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
This commit is contained in:
Friedemann Kleint
2010-11-03 13:37:01 +01:00
parent 7a0e15b14e
commit 019be3e850
5 changed files with 72 additions and 13 deletions

View File

@@ -276,7 +276,8 @@ GdbChooserWidget::GdbChooserWidget(QWidget *parent) :
m_treeView(new QTreeView),
m_model(new GdbBinaryModel),
m_addButton(new QToolButton),
m_deleteButton(new QToolButton)
m_deleteButton(new QToolButton),
m_dirty(false)
{
QHBoxLayout *mainHLayout = new QHBoxLayout;
@@ -339,6 +340,7 @@ void GdbChooserWidget::slotAdd()
}
// Add binary + toolchain to model
m_model->append(path, binaryDialog.toolChains());
m_dirty = true;
}
void GdbChooserWidget::slotRemove()
@@ -350,6 +352,7 @@ void GdbChooserWidget::slotRemove()
void GdbChooserWidget::removeItem(QStandardItem *item)
{
m_model->removeRow(item->row());
m_dirty = true;
}
void GdbChooserWidget::slotCurrentChanged(const QModelIndex &current, const QModelIndex &)
@@ -382,6 +385,7 @@ void GdbChooserWidget::slotDoubleClicked(const QModelIndex &current)
GdbBinaryModel::setBinaryItem(m_model->item(row, binaryColumn), newBinary);
GdbBinaryModel::setToolChainItem(m_model->item(row, toolChainColumn), newToolChains);
m_dirty = true;
}
GdbChooserWidget::BinaryToolChainMap GdbChooserWidget::gdbBinaries() const
@@ -394,6 +398,17 @@ void GdbChooserWidget::setGdbBinaries(const BinaryToolChainMap &m)
m_model->setGdbBinaries(m);
for (int c = 0; c < ColumnCount; c++)
m_treeView->resizeColumnToContents(c);
m_dirty = false;
}
bool GdbChooserWidget::isDirty() const
{
return m_dirty;
}
void GdbChooserWidget::clearDirty()
{
m_dirty = false;
}
// -------------- ToolChainSelectorWidget