QML Inspector: Don't misinterpret objects with ID 0

The invalid ID is -1 and we shouldn't send 0 to the engine debug
service by default as that will select some random object as context
for expression evaluation.

Change-Id: Ide245468f787cc449ff50ac846c7ff31620c01b4
Task-number: QTCREATORBUG-14931
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-12-01 10:58:01 +01:00
parent 75cfa50771
commit aeaddda37d
4 changed files with 23 additions and 21 deletions

View File

@@ -60,6 +60,8 @@ public:
| HasChildrenNeeded
};
static const qint64 InvalidId = -1;
void setAllUnneeded() { state = State(0); }
bool isValueNeeded() const { return state & ValueNeeded; }
@@ -99,7 +101,7 @@ public:
void updateDisplayedType(const GdbMi &item);
public:
quint64 id; // Token for the engine for internal mapping
qint64 id; // Token for the engine for internal mapping
qint32 state; // 'needed' flags;
QByteArray iname; // Internal name sth like 'local.baz.public.a'
QByteArray exp; // The expression