debugger: don't try to compute tooltip if it's not shown

This commit is contained in:
hjk
2010-06-29 10:58:09 +02:00
parent b50ba6a271
commit effc5abdd8
4 changed files with 39 additions and 16 deletions

View File

@@ -114,11 +114,8 @@ static const char winPythonVersionC[] = "python2.5";
#define CB(callback) &GdbEngine::callback, STRINGIFY(callback)
QByteArray GdbEngine::tooltipINameForExpression(const QByteArray &exp)
QByteArray GdbEngine::tooltipIName()
{
// FIXME: 'exp' can contain illegal characters
//return "tooltip." + exp;
Q_UNUSED(exp)
return "tooltip.x";
}
@@ -3204,10 +3201,17 @@ QPoint GdbEngine::m_toolTipPos;
bool GdbEngine::showToolTip()
{
QByteArray iname = tooltipIName();
if (!theDebuggerBoolSetting(UseToolTipsInMainEditor)) {
watchHandler()->removeData(iname);
return true;
}
WatchModel *model = watchHandler()->model(TooltipsWatch);
QByteArray iname = tooltipINameForExpression(m_toolTipExpression.toLatin1());
WatchItem *item = model->findItem(iname, model->rootItem());
if (!item) {
watchHandler()->removeData(iname);
hideDebuggerToolTip();
return false;
}
@@ -3301,7 +3305,7 @@ void GdbEngine::setToolTipExpression(const QPoint &mousePos,
WatchData toolTip;
toolTip.exp = exp.toLatin1();
toolTip.name = exp;
toolTip.iname = tooltipINameForExpression(toolTip.exp);
toolTip.iname = tooltipIName();
watchHandler()->removeData(toolTip.iname);
watchHandler()->insertData(toolTip);
}