Commit 532c18d7 authored by hjk's avatar hjk
Browse files

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

parent 50cabb92
......@@ -145,6 +145,7 @@ QAction *QtcSettingsItem::updatedAction(const QString &text0)
}
}
m_action->setEnabled(enabled);
m_action->setData(text0);
m_action->setText(text);
return m_action;
}
......
......@@ -3533,7 +3533,7 @@ void GdbEngine::updateWatchModel2()
void GdbEngine::handleQueryDataDumper(const GdbResultRecord &record)
{
qDebug() << "DATA DUMPER TRIAL:" << record.toString();
//qDebug() << "DATA DUMPER TRIAL:" << record.toString();
GdbMi output = record.data.findChild("consolestreamoutput");
QByteArray out = output.data();
out = out.mid(out.indexOf('"') + 2); // + 1 is success marker
......
......@@ -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);
......
......@@ -160,7 +160,9 @@ public:
//public slots:
void cleanup();
Q_SLOT void watchExpression(); // data in action->data().toString()
Q_SLOT void watchExpression(const QString &exp);
Q_SLOT void removeWatchExpression();
Q_SLOT void removeWatchExpression(const QString &exp);
void reinitializeWatchers();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment