forked from qt-creator/qt-creator
Android: Fix app waiting for qml engine connection
android app in mixed mode debugging sometimes keeps waiting for the qml engine connection. Task-number: QTCREATORBUG-17718 Change-Id: Iee87cd0a6d67babaf08e62a6e106ec22fda430cd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -569,15 +569,32 @@ void QmlEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
|
|||||||
if (result.qmlServerPort.isValid())
|
if (result.qmlServerPort.isValid())
|
||||||
runParameters().qmlServer.port = result.qmlServerPort;
|
runParameters().qmlServer.port = result.qmlServerPort;
|
||||||
|
|
||||||
notifyEngineSetupOk();
|
switch (state()) {
|
||||||
|
case InferiorSetupOk:
|
||||||
|
// FIXME: This is not a legal transition, but we need to
|
||||||
|
// get to EngineSetupOk somehow from InferiorSetupOk.
|
||||||
|
// fallthrough. QTCREATORBUG-14089.
|
||||||
|
case EngineSetupRequested:
|
||||||
|
notifyEngineSetupOk();
|
||||||
|
break;
|
||||||
|
case EngineSetupOk:
|
||||||
|
case EngineRunRequested:
|
||||||
|
// QTCREATORBUG-17718: On Android while doing debugging in mixed mode, the QML debug engine
|
||||||
|
// sometimes reports EngineSetupOK after the EngineRunRequested thus overwriting the state
|
||||||
|
// which eventually results into app to waiting for the QML engine connection.
|
||||||
|
// Skipping the EngineSetupOK in aforementioned case.
|
||||||
|
// Nothing to do here. The setup is already done.
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
QTC_ASSERT(false, qDebug() << "Unexpected state" << state());
|
||||||
|
}
|
||||||
|
|
||||||
// The remote setup can take while especialy with mixed debugging.
|
// The remote setup can take while especialy with mixed debugging.
|
||||||
// Just waiting for 8 seconds is not enough. Increase the timeout
|
// Just waiting for 8 seconds is not enough. Increase the timeout
|
||||||
// to 60 s
|
// to 60 s
|
||||||
// In case we get an output the d->outputParser will start the connection.
|
// In case we get an output the d->outputParser will start the connection.
|
||||||
d->noDebugOutputTimer.setInterval(60000);
|
d->noDebugOutputTimer.setInterval(60000);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (isMasterEngine())
|
if (isMasterEngine())
|
||||||
QMessageBox::critical(ICore::dialogParent(), tr("Failed to start application"),
|
QMessageBox::critical(ICore::dialogParent(), tr("Failed to start application"),
|
||||||
tr("Application startup failed: %1").arg(result.reason));
|
tr("Application startup failed: %1").arg(result.reason));
|
||||||
|
|||||||
Reference in New Issue
Block a user