Debugger: Fix action to remove all watch items.

This commit is contained in:
Friedemann Kleint
2011-01-17 09:12:37 +01:00
parent 2f6a86d6a5
commit 7bae5dd556
2 changed files with 4 additions and 3 deletions

View File

@@ -1330,8 +1330,9 @@ void WatchHandler::clearWatches()
{
if (m_watcherNames.isEmpty())
return;
foreach (WatchItem *item, m_watchers->rootItem()->children)
m_watchers->destroyItem(item);
const QList<WatchItem *> watches = m_watchers->rootItem()->children;
for (int i = watches.size() - 1; i >= 0; i--)
m_watchers->destroyItem(watches.at(i));
m_watcherNames.clear();
watcherCounter = 0;
updateWatchersWindow();

View File

@@ -379,7 +379,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *actRemoveWatchExpression = new QAction(removeWatchActionText(exp), &menu);
actRemoveWatchExpression->setEnabled(
(canHandleWatches || state == DebuggerNotReady) && !exp.isEmpty());
QAction *actRemoveWatches = new QAction(tr("Clear Watch Items"), &menu);
QAction *actRemoveWatches = new QAction(tr("Remove All Watch Items"), &menu);
actRemoveWatches->setEnabled(!WatchHandler::watcherNames().isEmpty());
if (m_type == LocalsType)