QmlDbg: Fix behavior when re-running the same run control

Change-Id: Icb405b4751fc885d8b96d1daec3653236b564ef0
Reviewed-on: http://codereview.qt.nokia.com/2352
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
Kai Koehne
2011-07-28 17:04:35 +02:00
parent 4453554cf4
commit 289acee78a
3 changed files with 53 additions and 42 deletions

View File

@@ -38,11 +38,12 @@
#include "debuggerengine.h"
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <QtCore/QTimer>
#include <QtCore/QDebug>
#include <utils/qtcassert.h>
namespace Debugger {
namespace Internal {
@@ -81,10 +82,19 @@ QmlAdapter::QmlAdapter(DebuggerEngine *engine, QObject *parent)
connect(d->m_conn, SIGNAL(error(QAbstractSocket::SocketError)),
SLOT(connectionErrorOccurred(QAbstractSocket::SocketError)));
ExtensionSystem::PluginManager *pluginManager =
ExtensionSystem::PluginManager::instance();
pluginManager->addObject(this);
}
QmlAdapter::~QmlAdapter()
{
ExtensionSystem::PluginManager *pluginManager =
ExtensionSystem::PluginManager::instance();
if (pluginManager->allObjects().contains(this)) {
pluginManager->removeObject(this);
}
}
void QmlAdapter::beginConnection()
@@ -191,7 +201,8 @@ void QmlAdapter::connectionStateChanged()
{
showConnectionStatusMessage(tr("connected.\n"));
createDebuggerClient();
if (!d->m_qmlClient)
createDebuggerClient();
//reloadEngines();
emit connected();
break;
@@ -226,9 +237,6 @@ bool QmlAdapter::isConnected() const
QDeclarativeDebugConnection *QmlAdapter::connection() const
{
if (!isConnected())
return 0;
return d->m_conn;
}