Debugger: Disable inapplicable context menu entries for sub-breakpoints

Task-Number: QTCREATORBUG-9984

Change-Id: Id4197b8d0db917606eb0e2767d2b05195e6cfbcd
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
hjk
2013-08-16 23:44:15 +02:00
parent adc9817671
commit e84f7f33a6
2 changed files with 12 additions and 2 deletions

View File

@@ -748,11 +748,14 @@ void BreakTreeView::contextMenuEvent(QContextMenuEvent *ev)
selectedIndices.append(indexUnderMouse);
BreakHandler *handler = breakHandler();
BreakpointModelIds selectedIds = handler->findBreakpointsByIndex(selectedIndices);
BreakpointModelIds selectedIds;
foreach (BreakpointModelId id, handler->findBreakpointsByIndex(selectedIndices))
if (id.isMajor())
selectedIds.append(id);
const int rowCount = model()->rowCount();
QAction *deleteAction = new QAction(tr("Delete Breakpoint"), &menu);
deleteAction->setEnabled(!selectedIds.isEmpty());
deleteAction->setEnabled(!selectedIds.empty());
QAction *deleteAllAction = new QAction(tr("Delete All Breakpoints"), &menu);
deleteAllAction->setEnabled(model()->rowCount() > 0);