diff options
author | David Boddie <david.boddie@nokia.com> | 2011-05-13 15:55:50 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-05-13 15:55:50 (GMT) |
commit | 4adf280fb6bda8e519bf23606b841e040cb04fab (patch) | |
tree | 88eda2f4f5cf46c9e68fa4aea7ca832aaa6c65db /src/declarative/debugger/qdeclarativedebug.cpp | |
parent | d9ef2f580bd78e658064e4fa3d0acf73b9c2a921 (diff) | |
parent | f32438ffccd8728143b93399e7cd251e72d23b55 (diff) | |
download | Qt-4adf280fb6bda8e519bf23606b841e040cb04fab.zip Qt-4adf280fb6bda8e519bf23606b841e040cb04fab.tar.gz Qt-4adf280fb6bda8e519bf23606b841e040cb04fab.tar.bz2 |
Merge branch '4.8'
Conflicts:
doc/src/declarative/whatsnew.qdoc
doc/src/examples/orientation.qdoc
doc/src/examples/webftpclient.qdoc
examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg
src/corelib/global/qglobal.cpp
src/gui/text/qglyphs.cpp
src/gui/text/qplatformfontdatabase_qpa.cpp
Diffstat (limited to 'src/declarative/debugger/qdeclarativedebug.cpp')
-rw-r--r-- | src/declarative/debugger/qdeclarativedebug.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp index 62eb8fe..049e05e 100644 --- a/src/declarative/debugger/qdeclarativedebug.cpp +++ b/src/declarative/debugger/qdeclarativedebug.cpp @@ -84,6 +84,7 @@ public: static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugRootContextQuery *); static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugObjectQuery *); static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugExpressionQuery *); + static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugWatch *); QHash<int, QDeclarativeDebugEnginesQuery *> enginesQuery; QHash<int, QDeclarativeDebugRootContextQuery *> rootContextQuery; @@ -120,6 +121,41 @@ QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate() { if (client) client->priv = 0; + delete client; + + QHash<int, QDeclarativeDebugEnginesQuery*>::iterator enginesIter = enginesQuery.begin(); + for (; enginesIter != enginesQuery.end(); ++enginesIter) { + enginesIter.value()->m_client = 0; + if (enginesIter.value()->state() == QDeclarativeDebugQuery::Waiting) + enginesIter.value()->setState(QDeclarativeDebugQuery::Error); + } + + QHash<int, QDeclarativeDebugRootContextQuery*>::iterator rootContextIter = rootContextQuery.begin(); + for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) { + rootContextIter.value()->m_client = 0; + if (rootContextIter.value()->state() == QDeclarativeDebugQuery::Waiting) + rootContextIter.value()->setState(QDeclarativeDebugQuery::Error); + } + + QHash<int, QDeclarativeDebugObjectQuery*>::iterator objectIter = objectQuery.begin(); + for (; objectIter != objectQuery.end(); ++objectIter) { + objectIter.value()->m_client = 0; + if (objectIter.value()->state() == QDeclarativeDebugQuery::Waiting) + objectIter.value()->setState(QDeclarativeDebugQuery::Error); + } + + QHash<int, QDeclarativeDebugExpressionQuery*>::iterator exprIter = expressionQuery.begin(); + for (; exprIter != expressionQuery.end(); ++exprIter) { + exprIter.value()->m_client = 0; + if (exprIter.value()->state() == QDeclarativeDebugQuery::Waiting) + exprIter.value()->setState(QDeclarativeDebugQuery::Error); + } + + QHash<int, QDeclarativeDebugWatch*>::iterator watchIter = watched.begin(); + for (; watchIter != watched.end(); ++watchIter) { + watchIter.value()->m_client = 0; + watchIter.value()->setState(QDeclarativeDebugWatch::Dead); + } } int QDeclarativeEngineDebugPrivate::getId() @@ -160,6 +196,14 @@ void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclara } } +void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugWatch *w) +{ + if (c && w) { + QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); + p->watched.remove(w->m_queryId); + } +} + void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o, bool simple) { @@ -647,6 +691,8 @@ QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent) QDeclarativeDebugWatch::~QDeclarativeDebugWatch() { + if (m_client && m_queryId != -1) + QDeclarativeEngineDebugPrivate::remove(m_client, this); } int QDeclarativeDebugWatch::queryId() const |