Commit effc5abd authored by hjk's avatar hjk

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

parent b50ba6a2
......@@ -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);
}
......
......@@ -520,7 +520,7 @@ private: ////////// View & Data Stuff //////////
static QString m_toolTipExpression;
static QPoint m_toolTipPos;
static QByteArray tooltipINameForExpression(const QByteArray &exp);
static QByteArray tooltipIName();
};
} // namespace Internal
......
......@@ -61,8 +61,7 @@ void GdbEngine::updateLocalsPython(const QByteArray &varList)
QByteArray watchers;
if (!m_toolTipExpression.isEmpty())
watchers += m_toolTipExpression.toLatin1()
+ '#' + tooltipINameForExpression(m_toolTipExpression.toLatin1());
watchers += m_toolTipExpression.toLatin1() + '#' + tooltipIName();
QHash<QByteArray, int> watcherNames = handler->watcherNames();
QHashIterator<QByteArray, int> it(watcherNames);
......
......@@ -187,13 +187,20 @@ private:
QHash<QObject *, Map::iterator> h;
};
class X : virtual public Foo
class X : public Foo
{
public:
X() {
}
};
class XX : virtual public Foo
{
public:
XX() {
}
};
class Y : virtual public Foo
{
public:
......@@ -201,13 +208,24 @@ public:
}
};
class D : public X, public Y
{
int diamond;
};
void testArray()
{
X xxx;
#if 1
X x;
XX xx;
D diamond;
Foo *f = &xx;
Foo ff;
double d[3][3];
for (int i = 0; i != 3; ++i)
for (int j = 0; j != 3; ++j)
d[i][j] = i + j;
#endif
char c[20];
c[0] = 'a';
......@@ -215,11 +233,12 @@ void testArray()
c[2] = 'c';
c[3] = 'd';
QString x[20];
x[0] = "a";
x[1] = "b";
x[2] = "c";
x[3] = "d";
#if 1
QString s[20];
s[0] = "a";
s[1] = "b";
s[2] = "c";
s[3] = "d";
Foo foo[10];
//for (int i = 0; i != sizeof(foo)/sizeof(foo[0]); ++i) {
......@@ -227,6 +246,7 @@ void testArray()
foo[i].a = i;
foo[i].doit();
}
#endif
}
#ifndef Q_CC_RVCT
......
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