void BreakHandler::updateMarkers()
{
- ConstIterator it = m_storage.constBegin(), et = m_storage.constEnd();
+ Iterator it = m_storage.begin(), et = m_storage.end();
for ( ; it != et; ++it)
- updateMarker(it.key());
-}
-
-void BreakHandler::updateMarker(BreakpointModelId id)
-{
- Iterator it = m_storage.find(id);
- BREAK_ASSERT(it != m_storage.end(), return);
-
- QString markerFileName = it->markerFileName();
- int markerLineNumber = it->markerLineNumber();
- if (it->marker && (markerFileName != it->marker->fileName()
- || markerLineNumber != it->marker->lineNumber()))
- it->destroyMarker();
-
- if (!it->marker && !markerFileName.isEmpty() && markerLineNumber > 0)
- it->marker = new BreakpointMarker(id, markerFileName, markerLineNumber);
+ it->updateMarker(it.key());
}
QVariant BreakHandler::headerData(int section,
return;
it->data.enabled = on;
it->destroyMarker();
- updateMarker(id);
+ it->updateMarker(id);
if (it->engine) {
it->state = BreakpointChangeRequested;
scheduleSynchronization();
return;
it->data.tracepoint = on;
it->destroyMarker();
+ it->updateMarker(id);
- updateMarker(id);
if (it->engine) {
it->state = BreakpointChangeRequested;
scheduleSynchronization();
it->response.fileName = fileName;
it->response.lineNumber = lineNumber;
it->destroyMarker();
- updateMarker(id);
+ it->updateMarker(id);
emit layoutChanged();
}
it->state = BreakpointInsertRequested;
it->response = BreakpointResponse();
it->response.fileName = it->data.fileName;
- updateMarker(id);
+ it->updateMarker(id);
scheduleSynchronization();
}
// FIXME: updateMarker() should recognize the need for icon changes.
if (state == BreakpointInserted) {
it->destroyMarker();
- updateMarker(id);
+ it->updateMarker(id);
}
layoutChanged();
}
it->engine = 0;
it->response = BreakpointResponse();
it->subItems.clear();
- delete it->marker;
- it->marker = 0;
+ it->destroyMarker();
+ it->updateMarker(id);
if (it->data.type == WatchpointAtAddress
|| it->data.type == WatchpointAtExpression
|| it->data.type == BreakpointByAddress)
it->data.enabled = false;
- updateMarker(id);
layoutChanged();
}
m_storage.insert(id, item);
endInsertRows();
+ item.updateMarker(id);
+
layoutChanged();
- updateMarker(id);
scheduleSynchronization();
}
item.response = response;
item.state = BreakpointInserted;
item.engine = engine;
+ item.updateMarker(id);
const int row = m_storage.size();
beginInsertRows(QModelIndex(), row, row);
endInsertRows();
layoutChanged();
-
- updateMarker(id);
scheduleSynchronization();
}
}
// FIXME: Should we tell gdb about the change?
it->response.lineNumber = lineNumber;
}
- updateMarker(id);
+ it->updateMarker(id);
emit layoutChanged();
}
{
Iterator it = m_storage.find(id);
BREAK_ASSERT(it != m_storage.end(), return);
- BreakpointItem &item = it.value();
- item.response = response;
- item.destroyMarker();
+ it->response = response;
+ it->destroyMarker();
+ it->updateMarker(id);
// Take over corrected values from response.
- if ((item.data.type == BreakpointByFileAndLine
- || item.data.type == BreakpointByFunction)
+ if ((it->data.type == BreakpointByFileAndLine
+ || it->data.type == BreakpointByFunction)
&& !response.module.isEmpty())
- item.data.module = response.module;
- updateMarker(id);
+ it->data.module = response.module;
}
void BreakHandler::changeBreakpointData(BreakpointModelId id,
it->data = data;
if (parts == NoParts) {
it->destroyMarker();
- updateMarker(id);
+ it->updateMarker(id);
layoutChanged();
} else if (it->needsChange() && it->engine && it->state != BreakpointNew) {
setState(id, BreakpointChangeRequested);
|| fileNameMatch(fileName, markerFileName()));
}
+void BreakHandler::BreakpointItem::updateMarker(BreakpointModelId id)
+{
+ QString file = markerFileName();
+ int line = markerLineNumber();
+ if (marker && (file != marker->fileName() || line != marker->lineNumber()))
+ destroyMarker();
+
+ if (!marker && !file.isEmpty() && line > 0)
+ marker = new BreakpointMarker(id, file, line);
+}
+
QIcon BreakHandler::BreakpointItem::icon() const
{
// FIXME: This seems to be called on each cursor blink as soon as the