debugger: Disable setting of watchpoints on non-existing variables

Task-number: QTCREATORBUG-5830
Change-Id: Iad4683c812e3f8debc3fe5852ee36adc4e5786ae
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-11-18 19:44:17 +01:00
committed by hjk
parent e64c33e0f7
commit ab45b7e663

View File

@@ -736,9 +736,17 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
tr("Setting a data breakpoint on an address will cause the program " tr("Setting a data breakpoint on an address will cause the program "
"to stop when the data at the address is modified.")); "to stop when the data at the address is modified."));
QAction *actSetWatchpointAtExpression = QAction *actSetWatchpointAtExpression = 0;
if (name.isEmpty()) {
actSetWatchpointAtExpression =
new QAction(tr("Add Data Breakpoint at Expression"),
&breakpointMenu);
actSetWatchpointAtExpression->setEnabled(false);
} else {
actSetWatchpointAtExpression =
new QAction(tr("Add Data Breakpoint at Expression \"%1\"").arg(name), new QAction(tr("Add Data Breakpoint at Expression \"%1\"").arg(name),
&breakpointMenu); &breakpointMenu);
}
actSetWatchpointAtExpression->setToolTip( actSetWatchpointAtExpression->setToolTip(
tr("Setting a data breakpoint on an expression will cause the program " tr("Setting a data breakpoint on an expression will cause the program "
"to stop when the data at the address given by the expression " "to stop when the data at the address given by the expression "