debugger: Fix context menu behavior for evaluated expression children

Task-number: QTCREATORBUG-5920
Change-Id: I5e215fd1df9596deb3b821764806f1db65096572
Reviewed-on: http://codereview.qt.nokia.com/3610
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-08-25 12:36:11 +02:00
committed by hjk
parent 8d936cec6e
commit d8c8603a32

View File

@@ -772,7 +772,11 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
actWatchExpression->setEnabled(canHandleWatches && !exp.isEmpty()); actWatchExpression->setEnabled(canHandleWatches && !exp.isEmpty());
// Can remove watch if engine can handle it or session engine. // Can remove watch if engine can handle it or session engine.
QAction *actRemoveWatchExpression = new QAction(removeWatchActionText(exp), &menu); QModelIndex p = mi0;
while (p.parent().isValid())
p = p.parent();
QString removeExp = p.data(LocalsExpressionRole).toString();
QAction *actRemoveWatchExpression = new QAction(removeWatchActionText(removeExp), &menu);
actRemoveWatchExpression->setEnabled( actRemoveWatchExpression->setEnabled(
(canHandleWatches || state == DebuggerNotReady) && !exp.isEmpty()); (canHandleWatches || state == DebuggerNotReady) && !exp.isEmpty());
QAction *actRemoveWatches = QAction *actRemoveWatches =
@@ -923,7 +927,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
} else if (act == actWatchExpression) { } else if (act == actWatchExpression) {
watchExpression(exp); watchExpression(exp);
} else if (act == actRemoveWatchExpression) { } else if (act == actRemoveWatchExpression) {
removeWatchExpression(exp); removeWatchExpression(removeExp);
} else if (act == actCopy) { } else if (act == actCopy) {
copyToClipboard(DebuggerToolTipWidget::treeModelClipboardContents(model())); copyToClipboard(DebuggerToolTipWidget::treeModelClipboardContents(model()));
} else if (act == actCopyValue) { } else if (act == actCopyValue) {