forked from qt-creator/qt-creator
QmlDebugger: Attach to QML Port: Fix errors
Connect to user defined host and port. Increased maximum connection tries. Change-Id: Ie72a9fb36e5178b64311753bd8a3fe20e6f62c3b Reviewed-on: http://codereview.qt-project.org/4918 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -1670,8 +1670,8 @@ void DebuggerPluginPrivate::attachToQmlPort()
|
|||||||
setConfigValue(_("LastQmlServerAddress"), dlg.host());
|
setConfigValue(_("LastQmlServerAddress"), dlg.host());
|
||||||
setConfigValue(_("LastQmlServerPort"), dlg.port());
|
setConfigValue(_("LastQmlServerPort"), dlg.port());
|
||||||
|
|
||||||
sp.serverAddress = dlg.host();
|
sp.qmlServerAddress = dlg.host();
|
||||||
sp.serverPort = dlg.port();
|
sp.qmlServerPort = dlg.port();
|
||||||
|
|
||||||
sp.startMode = AttachToQmlPort;
|
sp.startMode = AttachToQmlPort;
|
||||||
if (RunControl *rc = createDebugger(sp))
|
if (RunControl *rc = createDebugger(sp))
|
||||||
|
|||||||
@@ -54,19 +54,15 @@ public:
|
|||||||
explicit QmlAdapterPrivate(DebuggerEngine *engine)
|
explicit QmlAdapterPrivate(DebuggerEngine *engine)
|
||||||
: m_engine(engine)
|
: m_engine(engine)
|
||||||
, m_qmlClient(0)
|
, m_qmlClient(0)
|
||||||
, m_connectionAttempts(0)
|
|
||||||
, m_maxConnectionAttempts(50) // overall time: 50 x 200ms
|
|
||||||
, m_conn(0)
|
, m_conn(0)
|
||||||
{
|
{
|
||||||
m_connectionTimer.setInterval(200);
|
m_connectionTimer.setInterval(4000);
|
||||||
|
m_connectionTimer.setSingleShot(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWeakPointer<DebuggerEngine> m_engine;
|
QWeakPointer<DebuggerEngine> m_engine;
|
||||||
QmlDebuggerClient *m_qmlClient;
|
QmlDebuggerClient *m_qmlClient;
|
||||||
|
|
||||||
QTimer m_connectionTimer;
|
QTimer m_connectionTimer;
|
||||||
int m_connectionAttempts;
|
|
||||||
int m_maxConnectionAttempts;
|
|
||||||
QDeclarativeDebugConnection *m_conn;
|
QDeclarativeDebugConnection *m_conn;
|
||||||
QHash<QString, QmlDebuggerClient*> debugClients;
|
QHash<QString, QmlDebuggerClient*> debugClients;
|
||||||
};
|
};
|
||||||
@@ -76,7 +72,7 @@ public:
|
|||||||
QmlAdapter::QmlAdapter(DebuggerEngine *engine, QObject *parent)
|
QmlAdapter::QmlAdapter(DebuggerEngine *engine, QObject *parent)
|
||||||
: QObject(parent), d(new Internal::QmlAdapterPrivate(engine))
|
: QObject(parent), d(new Internal::QmlAdapterPrivate(engine))
|
||||||
{
|
{
|
||||||
connect(&d->m_connectionTimer, SIGNAL(timeout()), SLOT(pollInferior()));
|
connect(&d->m_connectionTimer, SIGNAL(timeout()), SLOT(checkConnectionState()));
|
||||||
d->m_conn = new QDeclarativeDebugConnection(this);
|
d->m_conn = new QDeclarativeDebugConnection(this);
|
||||||
connect(d->m_conn, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
|
connect(d->m_conn, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
|
||||||
SLOT(connectionStateChanged()));
|
SLOT(connectionStateChanged()));
|
||||||
@@ -86,6 +82,8 @@ QmlAdapter::QmlAdapter(DebuggerEngine *engine, QObject *parent)
|
|||||||
ExtensionSystem::PluginManager *pluginManager =
|
ExtensionSystem::PluginManager *pluginManager =
|
||||||
ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager::instance();
|
||||||
pluginManager->addObject(this);
|
pluginManager->addObject(this);
|
||||||
|
|
||||||
|
createDebuggerClients();
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlAdapter::~QmlAdapter()
|
QmlAdapter::~QmlAdapter()
|
||||||
@@ -99,38 +97,6 @@ QmlAdapter::~QmlAdapter()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QmlAdapter::beginConnection()
|
void QmlAdapter::beginConnection()
|
||||||
{
|
|
||||||
d->m_connectionAttempts = 0;
|
|
||||||
d->m_connectionTimer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlAdapter::closeConnection()
|
|
||||||
{
|
|
||||||
if (d->m_connectionTimer.isActive()) {
|
|
||||||
d->m_connectionTimer.stop();
|
|
||||||
} else {
|
|
||||||
if (d->m_conn)
|
|
||||||
d->m_conn->close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlAdapter::pollInferior()
|
|
||||||
{
|
|
||||||
++d->m_connectionAttempts;
|
|
||||||
|
|
||||||
if (isConnected()) {
|
|
||||||
d->m_connectionTimer.stop();
|
|
||||||
d->m_connectionAttempts = 0;
|
|
||||||
} else if (d->m_connectionAttempts == d->m_maxConnectionAttempts) {
|
|
||||||
d->m_connectionTimer.stop();
|
|
||||||
d->m_connectionAttempts = 0;
|
|
||||||
emit connectionStartupFailed();
|
|
||||||
} else {
|
|
||||||
connectToViewer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlAdapter::connectToViewer()
|
|
||||||
{
|
{
|
||||||
if (d->m_engine.isNull()
|
if (d->m_engine.isNull()
|
||||||
|| (d->m_conn && d->m_conn->state() != QAbstractSocket::UnconnectedState))
|
|| (d->m_conn && d->m_conn->state() != QAbstractSocket::UnconnectedState))
|
||||||
@@ -147,6 +113,20 @@ void QmlAdapter::connectToViewer()
|
|||||||
showConnectionStatusMessage(tr("Connecting to debug server %1:%2").arg(address).arg(QString::number(port)));
|
showConnectionStatusMessage(tr("Connecting to debug server %1:%2").arg(address).arg(QString::number(port)));
|
||||||
d->m_conn->connectToHost(address, port);
|
d->m_conn->connectToHost(address, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//A timeout to check the connection state
|
||||||
|
d->m_connectionTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QmlAdapter::closeConnection()
|
||||||
|
{
|
||||||
|
if (d->m_connectionTimer.isActive()) {
|
||||||
|
d->m_connectionTimer.stop();
|
||||||
|
} else {
|
||||||
|
if (d->m_conn) {
|
||||||
|
d->m_conn->close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlAdapter::connectionErrorOccurred(QAbstractSocket::SocketError socketError)
|
void QmlAdapter::connectionErrorOccurred(QAbstractSocket::SocketError socketError)
|
||||||
@@ -155,8 +135,12 @@ void QmlAdapter::connectionErrorOccurred(QAbstractSocket::SocketError socketErro
|
|||||||
.arg(socketError).arg(d->m_conn->errorString()));
|
.arg(socketError).arg(d->m_conn->errorString()));
|
||||||
|
|
||||||
// this is only an error if we are already connected and something goes wrong.
|
// this is only an error if we are already connected and something goes wrong.
|
||||||
if (isConnected())
|
if (isConnected()) {
|
||||||
emit connectionError(socketError);
|
emit connectionError(socketError);
|
||||||
|
} else {
|
||||||
|
d->m_connectionTimer.stop();
|
||||||
|
emit connectionStartupFailed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlAdapter::clientStatusChanged(QDeclarativeDebugClient::Status status)
|
void QmlAdapter::clientStatusChanged(QDeclarativeDebugClient::Status status)
|
||||||
@@ -194,8 +178,7 @@ void QmlAdapter::connectionStateChanged()
|
|||||||
{
|
{
|
||||||
showConnectionStatusMessage(tr("connected.\n"));
|
showConnectionStatusMessage(tr("connected.\n"));
|
||||||
|
|
||||||
if (!d->m_qmlClient)
|
d->m_connectionTimer.stop();
|
||||||
createDebuggerClients();
|
|
||||||
|
|
||||||
//reloadEngines();
|
//reloadEngines();
|
||||||
emit connected();
|
emit connected();
|
||||||
@@ -210,6 +193,14 @@ void QmlAdapter::connectionStateChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlAdapter::checkConnectionState()
|
||||||
|
{
|
||||||
|
if (!isConnected()) {
|
||||||
|
closeConnection();
|
||||||
|
emit connectionStartupFailed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void QmlAdapter::createDebuggerClients()
|
void QmlAdapter::createDebuggerClients()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -88,10 +88,9 @@ private slots:
|
|||||||
void connectionErrorOccurred(QAbstractSocket::SocketError socketError);
|
void connectionErrorOccurred(QAbstractSocket::SocketError socketError);
|
||||||
void clientStatusChanged(QDeclarativeDebugClient::Status status);
|
void clientStatusChanged(QDeclarativeDebugClient::Status status);
|
||||||
void connectionStateChanged();
|
void connectionStateChanged();
|
||||||
void pollInferior();
|
void checkConnectionState();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void connectToViewer();
|
|
||||||
void createDebuggerClients();
|
void createDebuggerClients();
|
||||||
void showConnectionStatusMessage(const QString &message);
|
void showConnectionStatusMessage(const QString &message);
|
||||||
void showConnectionErrorMessage(const QString &message);
|
void showConnectionErrorMessage(const QString &message);
|
||||||
|
|||||||
@@ -137,10 +137,14 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
|
|||||||
SIGNAL(processExited(int)),
|
SIGNAL(processExited(int)),
|
||||||
SLOT(disconnected()));
|
SLOT(disconnected()));
|
||||||
connect(&d->m_applicationLauncher,
|
connect(&d->m_applicationLauncher,
|
||||||
SIGNAL(appendMessage(QString,Utils::OutputFormat)),
|
SIGNAL(appendMessage(QString, Utils::OutputFormat)),
|
||||||
SLOT(appendMessage(QString,Utils::OutputFormat)));
|
SLOT(appendMessage(QString, Utils::OutputFormat)));
|
||||||
|
connect(&d->m_applicationLauncher,
|
||||||
|
SIGNAL(processStarted()),
|
||||||
|
&d->m_noDebugOutputTimer,
|
||||||
|
SLOT(start()));
|
||||||
|
|
||||||
// Only wait 8 seconds for the 'Waiting for connection' on application ouput, then just try to connect
|
// Only wait 8 seconds for the 'Waiting for connection' on application ouput, then just try to connect
|
||||||
// (application output might be redirected / blocked)
|
// (application output might be redirected / blocked)
|
||||||
d->m_noDebugOutputTimer.setSingleShot(true);
|
d->m_noDebugOutputTimer.setSingleShot(true);
|
||||||
d->m_noDebugOutputTimer.setInterval(8000);
|
d->m_noDebugOutputTimer.setInterval(8000);
|
||||||
@@ -167,6 +171,9 @@ void QmlEngine::setupInferior()
|
|||||||
emit requestRemoteSetup();
|
emit requestRemoteSetup();
|
||||||
if (startParameters().qmlServerPort != quint16(-1))
|
if (startParameters().qmlServerPort != quint16(-1))
|
||||||
notifyInferiorSetupOk();
|
notifyInferiorSetupOk();
|
||||||
|
} if (startParameters().startMode == AttachToQmlPort) {
|
||||||
|
notifyInferiorSetupOk();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
d->m_applicationLauncher.setEnvironment(startParameters().environment);
|
d->m_applicationLauncher.setEnvironment(startParameters().environment);
|
||||||
d->m_applicationLauncher.setWorkingDirectory(startParameters().workingDirectory);
|
d->m_applicationLauncher.setWorkingDirectory(startParameters().workingDirectory);
|
||||||
@@ -197,6 +204,7 @@ void QmlEngine::connectionEstablished()
|
|||||||
void QmlEngine::beginConnection()
|
void QmlEngine::beginConnection()
|
||||||
{
|
{
|
||||||
d->m_noDebugOutputTimer.stop();
|
d->m_noDebugOutputTimer.stop();
|
||||||
|
showMessage(tr("QML Debugger connecting..."), StatusBar);
|
||||||
d->m_adapter.beginConnection();
|
d->m_adapter.beginConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,6 +248,9 @@ void QmlEngine::connectionError(QAbstractSocket::SocketError socketError)
|
|||||||
{
|
{
|
||||||
if (socketError == QAbstractSocket::RemoteHostClosedError)
|
if (socketError == QAbstractSocket::RemoteHostClosedError)
|
||||||
showMessage(tr("QML Debugger: Remote host closed connection."), StatusBar);
|
showMessage(tr("QML Debugger: Remote host closed connection."), StatusBar);
|
||||||
|
|
||||||
|
notifyInferiorSpontaneousStop();
|
||||||
|
notifyInferiorIll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlEngine::serviceConnectionError(const QString &serviceName)
|
void QmlEngine::serviceConnectionError(const QString &serviceName)
|
||||||
@@ -333,7 +344,9 @@ void QmlEngine::runEngine()
|
|||||||
if (!isSlaveEngine() && startParameters().startMode != AttachToRemoteServer
|
if (!isSlaveEngine() && startParameters().startMode != AttachToRemoteServer
|
||||||
&& startParameters().startMode != AttachToQmlPort)
|
&& startParameters().startMode != AttachToQmlPort)
|
||||||
startApplicationLauncher();
|
startApplicationLauncher();
|
||||||
d->m_noDebugOutputTimer.start();
|
|
||||||
|
if (startParameters().startMode == AttachToQmlPort)
|
||||||
|
beginConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlEngine::startApplicationLauncher()
|
void QmlEngine::startApplicationLauncher()
|
||||||
@@ -375,6 +388,9 @@ void QmlEngine::handleRemoteSetupFailed(const QString &message)
|
|||||||
|
|
||||||
void QmlEngine::shutdownInferior()
|
void QmlEngine::shutdownInferior()
|
||||||
{
|
{
|
||||||
|
d->m_noDebugOutputTimer.stop();
|
||||||
|
|
||||||
|
if (d->m_adapter.activeDebuggerClient())
|
||||||
d->m_adapter.activeDebuggerClient()->endSession();
|
d->m_adapter.activeDebuggerClient()->endSession();
|
||||||
|
|
||||||
if (isSlaveEngine()) {
|
if (isSlaveEngine()) {
|
||||||
@@ -409,8 +425,10 @@ void QmlEngine::setupEngine()
|
|||||||
void QmlEngine::continueInferior()
|
void QmlEngine::continueInferior()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
|
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
|
||||||
|
if (d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, "CONTINUE");
|
logMessage(LogSend, "CONTINUE");
|
||||||
d->m_adapter.activeDebuggerClient()->continueInferior();
|
d->m_adapter.activeDebuggerClient()->continueInferior();
|
||||||
|
}
|
||||||
resetLocation();
|
resetLocation();
|
||||||
notifyInferiorRunRequested();
|
notifyInferiorRunRequested();
|
||||||
notifyInferiorRunOk();
|
notifyInferiorRunOk();
|
||||||
@@ -418,15 +436,19 @@ void QmlEngine::continueInferior()
|
|||||||
|
|
||||||
void QmlEngine::interruptInferior()
|
void QmlEngine::interruptInferior()
|
||||||
{
|
{
|
||||||
|
if (d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, "INTERRUPT");
|
logMessage(LogSend, "INTERRUPT");
|
||||||
d->m_adapter.activeDebuggerClient()->interruptInferior();
|
d->m_adapter.activeDebuggerClient()->interruptInferior();
|
||||||
|
}
|
||||||
notifyInferiorStopOk();
|
notifyInferiorStopOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlEngine::executeStep()
|
void QmlEngine::executeStep()
|
||||||
{
|
{
|
||||||
|
if (d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, "STEPINTO");
|
logMessage(LogSend, "STEPINTO");
|
||||||
d->m_adapter.activeDebuggerClient()->executeStep();
|
d->m_adapter.activeDebuggerClient()->executeStep();
|
||||||
|
}
|
||||||
resetLocation();
|
resetLocation();
|
||||||
notifyInferiorRunRequested();
|
notifyInferiorRunRequested();
|
||||||
notifyInferiorRunOk();
|
notifyInferiorRunOk();
|
||||||
@@ -434,8 +456,10 @@ void QmlEngine::executeStep()
|
|||||||
|
|
||||||
void QmlEngine::executeStepI()
|
void QmlEngine::executeStepI()
|
||||||
{
|
{
|
||||||
|
if (d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, "STEPINTO");
|
logMessage(LogSend, "STEPINTO");
|
||||||
d->m_adapter.activeDebuggerClient()->executeStepI();
|
d->m_adapter.activeDebuggerClient()->executeStepI();
|
||||||
|
}
|
||||||
resetLocation();
|
resetLocation();
|
||||||
notifyInferiorRunRequested();
|
notifyInferiorRunRequested();
|
||||||
notifyInferiorRunOk();
|
notifyInferiorRunOk();
|
||||||
@@ -443,8 +467,10 @@ void QmlEngine::executeStepI()
|
|||||||
|
|
||||||
void QmlEngine::executeStepOut()
|
void QmlEngine::executeStepOut()
|
||||||
{
|
{
|
||||||
|
if (d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, "STEPOUT");
|
logMessage(LogSend, "STEPOUT");
|
||||||
d->m_adapter.activeDebuggerClient()->executeStepOut();
|
d->m_adapter.activeDebuggerClient()->executeStepOut();
|
||||||
|
}
|
||||||
resetLocation();
|
resetLocation();
|
||||||
notifyInferiorRunRequested();
|
notifyInferiorRunRequested();
|
||||||
notifyInferiorRunOk();
|
notifyInferiorRunOk();
|
||||||
@@ -452,8 +478,10 @@ void QmlEngine::executeStepOut()
|
|||||||
|
|
||||||
void QmlEngine::executeNext()
|
void QmlEngine::executeNext()
|
||||||
{
|
{
|
||||||
|
if (d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, "STEPOVER");
|
logMessage(LogSend, "STEPOVER");
|
||||||
d->m_adapter.activeDebuggerClient()->executeNext();
|
d->m_adapter.activeDebuggerClient()->executeNext();
|
||||||
|
}
|
||||||
resetLocation();
|
resetLocation();
|
||||||
notifyInferiorRunRequested();
|
notifyInferiorRunRequested();
|
||||||
notifyInferiorRunOk();
|
notifyInferiorRunOk();
|
||||||
@@ -484,8 +512,10 @@ void QmlEngine::executeJumpToLine(const ContextData &data)
|
|||||||
|
|
||||||
void QmlEngine::activateFrame(int index)
|
void QmlEngine::activateFrame(int index)
|
||||||
{
|
{
|
||||||
|
if (d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, QString("%1 %2").arg(QString("ACTIVATE_FRAME"), QString::number(index)));
|
logMessage(LogSend, QString("%1 %2").arg(QString("ACTIVATE_FRAME"), QString::number(index)));
|
||||||
d->m_adapter.activeDebuggerClient()->activateFrame(index);
|
d->m_adapter.activeDebuggerClient()->activateFrame(index);
|
||||||
|
}
|
||||||
gotoLocation(stackHandler()->frames().value(index));
|
gotoLocation(stackHandler()->frames().value(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -660,7 +690,7 @@ void QmlEngine::assignValueInDebugger(const WatchData *data,
|
|||||||
const QString &expression, const QVariant &valueV)
|
const QString &expression, const QVariant &valueV)
|
||||||
{
|
{
|
||||||
quint64 objectId = data->id;
|
quint64 objectId = data->id;
|
||||||
if (objectId > 0 && !expression.isEmpty()) {
|
if (objectId > 0 && !expression.isEmpty() && d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, QString("%1 %2 %3 %4 %5").arg(
|
logMessage(LogSend, QString("%1 %2 %3 %4 %5").arg(
|
||||||
QString("SET_PROPERTY"), QString::number(objectId), QString(expression),
|
QString("SET_PROPERTY"), QString::number(objectId), QString(expression),
|
||||||
valueV.toString()));
|
valueV.toString()));
|
||||||
@@ -675,16 +705,17 @@ void QmlEngine::updateWatchData(const WatchData &data,
|
|||||||
//watchHandler()->rebuildModel();
|
//watchHandler()->rebuildModel();
|
||||||
showStatusMessage(tr("Stopped."), 5000);
|
showStatusMessage(tr("Stopped."), 5000);
|
||||||
|
|
||||||
if (!data.name.isEmpty() && data.isValueNeeded()) {
|
if (!data.name.isEmpty() && d->m_adapter.activeDebuggerClient()) {
|
||||||
|
if (data.isValueNeeded()) {
|
||||||
logMessage(LogSend, QString("%1 %2 %3").arg(QString("EXEC"), QString(data.iname),
|
logMessage(LogSend, QString("%1 %2 %3").arg(QString("EXEC"), QString(data.iname),
|
||||||
QString(data.name)));
|
QString(data.name)));
|
||||||
d->m_adapter.activeDebuggerClient()->updateWatchData(&data);
|
d->m_adapter.activeDebuggerClient()->updateWatchData(&data);
|
||||||
}
|
}
|
||||||
|
if (data.isChildrenNeeded()
|
||||||
if (!data.name.isEmpty() && data.isChildrenNeeded()
|
|
||||||
&& watchHandler()->isExpandedIName(data.iname)) {
|
&& watchHandler()->isExpandedIName(data.iname)) {
|
||||||
d->m_adapter.activeDebuggerClient()->expandObject(data.iname, data.id);
|
d->m_adapter.activeDebuggerClient()->expandObject(data.iname, data.id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
synchronizeWatchers();
|
synchronizeWatchers();
|
||||||
|
|
||||||
@@ -722,10 +753,12 @@ unsigned QmlEngine::debuggerCapabilities() const
|
|||||||
|
|
||||||
QString QmlEngine::toFileInProject(const QUrl &fileUrl)
|
QString QmlEngine::toFileInProject(const QUrl &fileUrl)
|
||||||
{
|
{
|
||||||
|
if (startParameters().startMode != AttachToQmlPort) {
|
||||||
if (d->fileFinder.projectDirectory().isEmpty()) {
|
if (d->fileFinder.projectDirectory().isEmpty()) {
|
||||||
d->fileFinder.setProjectDirectory(startParameters().projectSourceDirectory);
|
d->fileFinder.setProjectDirectory(startParameters().projectSourceDirectory);
|
||||||
d->fileFinder.setProjectFiles(startParameters().projectSourceFiles);
|
d->fileFinder.setProjectFiles(startParameters().projectSourceFiles);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return d->fileFinder.findFile(fileUrl);
|
return d->fileFinder.findFile(fileUrl);
|
||||||
}
|
}
|
||||||
@@ -753,9 +786,11 @@ void QmlEngine::wrongSetupMessageBoxFinished(int result)
|
|||||||
|
|
||||||
void QmlEngine::executeDebuggerCommand(const QString& command)
|
void QmlEngine::executeDebuggerCommand(const QString& command)
|
||||||
{
|
{
|
||||||
|
if (d->m_adapter.activeDebuggerClient()) {
|
||||||
logMessage(LogSend, QString("%1 %2 %3").arg(QString("EXEC"), QString("console"),
|
logMessage(LogSend, QString("%1 %2 %3").arg(QString("EXEC"), QString("console"),
|
||||||
QString(command)));
|
QString(command)));
|
||||||
d->m_adapter.activeDebuggerClient()->executeDebuggerCommand(command);
|
d->m_adapter.activeDebuggerClient()->executeDebuggerCommand(command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,6 @@ InspectorUi::InspectorUi(QObject *parent)
|
|||||||
, m_clientProxy(0)
|
, m_clientProxy(0)
|
||||||
, m_qmlEngine(0)
|
, m_qmlEngine(0)
|
||||||
, m_debugQuery(0)
|
, m_debugQuery(0)
|
||||||
, m_debugProject(0)
|
|
||||||
, m_selectionCallbackExpected(false)
|
, m_selectionCallbackExpected(false)
|
||||||
, m_cursorPositionChangedExternally(false)
|
, m_cursorPositionChangedExternally(false)
|
||||||
{
|
{
|
||||||
@@ -310,11 +309,12 @@ void InspectorUi::connected(ClientProxy *clientProxy)
|
|||||||
it.value()->resetInitialDoc(doc);
|
it.value()->resetInitialDoc(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_debugProject = ProjectExplorer::ProjectExplorerPlugin::instance()->startupProject();
|
// project is needed for matching filenames, esp. with shadow builds.
|
||||||
|
ProjectExplorer::Project *debugProject = ProjectExplorer::ProjectExplorerPlugin::instance()->startupProject();
|
||||||
connect(m_debugProject, SIGNAL(destroyed()), SLOT(currentDebugProjectRemoved()));
|
if (debugProject) {
|
||||||
m_projectFinder.setProjectDirectory(m_debugProject->projectDirectory());
|
m_projectFinder.setProjectDirectory(debugProject->projectDirectory());
|
||||||
m_projectFinder.setProjectFiles(m_debugProject->files(ProjectExplorer::Project::AllFiles));
|
m_projectFinder.setProjectFiles(debugProject->files(ProjectExplorer::Project::AllFiles));
|
||||||
|
}
|
||||||
|
|
||||||
connectSignals();
|
connectSignals();
|
||||||
enable();
|
enable();
|
||||||
@@ -335,7 +335,6 @@ void InspectorUi::disconnected()
|
|||||||
disconnectSignals();
|
disconnectSignals();
|
||||||
disable();
|
disable();
|
||||||
|
|
||||||
m_debugProject = 0;
|
|
||||||
m_qmlEngine = 0;
|
m_qmlEngine = 0;
|
||||||
resetViews();
|
resetViews();
|
||||||
|
|
||||||
@@ -489,11 +488,6 @@ QmlJSLiveTextPreview *InspectorUi::createPreviewForEditor(Core::IEditor *newEdit
|
|||||||
return preview;
|
return preview;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InspectorUi::currentDebugProjectRemoved()
|
|
||||||
{
|
|
||||||
m_debugProject = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void InspectorUi::resetViews()
|
void InspectorUi::resetViews()
|
||||||
{
|
{
|
||||||
m_propertyInspector->clear();
|
m_propertyInspector->clear();
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ private slots:
|
|||||||
void disableLivePreview();
|
void disableLivePreview();
|
||||||
void crumblePathElementClicked(const QVariant &data);
|
void crumblePathElementClicked(const QVariant &data);
|
||||||
|
|
||||||
void currentDebugProjectRemoved();
|
|
||||||
void updatePendingPreviewDocuments(QmlJS::Document::Ptr doc);
|
void updatePendingPreviewDocuments(QmlJS::Document::Ptr doc);
|
||||||
void showDebuggerTooltip(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
void showDebuggerTooltip(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
||||||
void debugQueryUpdated(QDeclarativeDebugQuery::State);
|
void debugQueryUpdated(QDeclarativeDebugQuery::State);
|
||||||
@@ -167,9 +166,6 @@ private:
|
|||||||
QHash<QString, QmlJSLiveTextPreview *> m_textPreviews;
|
QHash<QString, QmlJSLiveTextPreview *> m_textPreviews;
|
||||||
QmlJS::Snapshot m_loadedSnapshot; //the snapshot loaded by the viewer
|
QmlJS::Snapshot m_loadedSnapshot; //the snapshot loaded by the viewer
|
||||||
|
|
||||||
// project is needed for matching filenames, esp. with shadow builds.
|
|
||||||
ProjectExplorer::Project *m_debugProject;
|
|
||||||
|
|
||||||
QStringList m_pendingPreviewDocumentNames;
|
QStringList m_pendingPreviewDocumentNames;
|
||||||
Utils::FileInProjectFinder m_projectFinder;
|
Utils::FileInProjectFinder m_projectFinder;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user