debugger: make '0' the 'invalid' BreakpointId value

This commit is contained in:
hjk
2010-12-01 11:52:18 +01:00
parent 739144ce91
commit a638b9338e
4 changed files with 23 additions and 23 deletions

View File

@@ -2391,7 +2391,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditor::ITextEditor *editor,
if (!isDebuggable(editor))
return;
BreakpointId id = -1;
BreakpointId id = BreakpointId();
QString fileName;
quint64 address = 0;
@@ -2415,7 +2415,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditor::ITextEditor *editor,
args.append(lineNumber);
args.append(address);
if (id != BreakpointId(-1)) {
if (id) {
// Remove existing breakpoint.
QAction *act = new QAction(menu);
act->setData(int(id));
@@ -2497,10 +2497,10 @@ void DebuggerPluginPrivate::toggleBreakpointByFileAndLine(const QString &fileNam
BreakHandler *handler = m_breakHandler;
BreakpointId id =
handler->findBreakpointByFileAndLine(fileName, lineNumber, true);
if (id == BreakpointId(-1))
if (!id)
id = handler->findBreakpointByFileAndLine(fileName, lineNumber, false);
if (id != BreakpointId(-1)) {
if (id) {
handler->removeBreakpoint(id);
} else {
BreakpointParameters data(BreakpointByFileAndLine);
@@ -2516,7 +2516,7 @@ void DebuggerPluginPrivate::toggleBreakpointByAddress(quint64 address)
BreakHandler *handler = m_breakHandler;
BreakpointId id = handler->findBreakpointByAddress(address);
if (id != BreakpointId(-1)) {
if (id) {
handler->removeBreakpoint(id);
} else {
BreakpointParameters data(BreakpointByAddress);