Debugger: Disable watcher removals

... when engine does not support watcher insertion while running.

Change-Id: I1b4500f75b43176df7dc31f4a5840afb2347dd36
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-05-12 15:19:01 +02:00
parent b45bfbf69c
commit 54e85ad100

View File

@@ -737,14 +737,15 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
p = pp; p = pp;
} }
bool showExpressionActions = (canHandleWatches || state == DebuggerNotReady) && m_type == WatchersType; bool canRemoveWatches = ((canHandleWatches && canInsertWatches) || state == DebuggerNotReady)
&& m_type == WatchersType;
QString removeExp = p.data(LocalsExpressionRole).toString(); QString removeExp = p.data(LocalsExpressionRole).toString();
QAction actRemoveWatchExpression(removeWatchActionText(removeExp), 0); QAction actRemoveWatchExpression(removeWatchActionText(removeExp), 0);
actRemoveWatchExpression.setEnabled(showExpressionActions && !exp.isEmpty()); actRemoveWatchExpression.setEnabled(canRemoveWatches && !exp.isEmpty());
QAction actRemoveAllWatchExpression(tr("Remove All Expression Evaluators"), 0); QAction actRemoveAllWatchExpression(tr("Remove All Expression Evaluators"), 0);
actRemoveAllWatchExpression.setEnabled(showExpressionActions actRemoveAllWatchExpression.setEnabled(canRemoveWatches
&& !handler->watchedExpressions().isEmpty()); && !handler->watchedExpressions().isEmpty());
QMenu formatMenu(tr("Change Local Display Format...")); QMenu formatMenu(tr("Change Local Display Format..."));