debugger: make add & remove wathcers work again after the action changes

This commit is contained in:
hjk
2009-03-19 12:53:58 +01:00
parent 50cabb9216
commit 532c18d723
4 changed files with 20 additions and 5 deletions

View File

@@ -368,11 +368,11 @@ WatchHandler::WatchHandler()
m_incompleteSet.clear();
m_displaySet = m_completeSet;
connect(theDebuggerSetting(WatchExpression), SIGNAL(stringValueChanged(QString)),
this, SLOT(watchExpression(QString)));
connect(theDebuggerSetting(WatchExpression)->action(),
SIGNAL(triggered()), this, SLOT(watchExpression()));
connect(theDebuggerSetting(RemoveWatchExpression), SIGNAL(stringValueChanged(QString)),
this, SLOT(removeWatchExpression(QString)));
connect(theDebuggerSetting(RemoveWatchExpression)->action(),
SIGNAL(triggered()), this, SLOT(removeWatchExpression()));
}
bool WatchHandler::setData(const QModelIndex &idx,
@@ -884,6 +884,12 @@ void WatchHandler::insertData(const WatchData &data)
//MODEL_DEBUG("INSERT RESULT" << toString());
}
void WatchHandler::watchExpression()
{
if (QAction *action = qobject_cast<QAction *>(sender()))
watchExpression(action->data().toString());
}
void WatchHandler::watchExpression(const QString &exp)
{
// FIXME: 'exp' can contain illegal characters
@@ -969,6 +975,12 @@ void WatchHandler::showEditValue(const WatchData &data)
w->show();
}
void WatchHandler::removeWatchExpression()
{
if (QAction *action = qobject_cast<QAction *>(sender()))
removeWatchExpression(action->data().toString());
}
void WatchHandler::removeWatchExpression(const QString &exp)
{
MODEL_DEBUG("REMOVE WATCH: " << exp);