forked from qt-creator/qt-creator
QmlDebugging: Connect for Run In Terminal
Connect to Qml Debug Server for Run In Terminal. Task-number: QTCREATORBUG-7057 Change-Id: Ieb166e4fc74cad2ef7a3774e0156cdbf07e8dc56 Reviewed-by: Kai Koehne <kai.koehne@nokia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
@@ -119,11 +119,13 @@ private:
|
||||
InteractiveInterpreter m_interpreter;
|
||||
bool m_validContext;
|
||||
QHash<QString,BreakpointModelId> pendingBreakpoints;
|
||||
bool m_retryOnConnectFail;
|
||||
};
|
||||
|
||||
QmlEnginePrivate::QmlEnginePrivate(QmlEngine *q)
|
||||
: m_adapter(q),
|
||||
m_validContext(false)
|
||||
m_validContext(false),
|
||||
m_retryOnConnectFail(false)
|
||||
{}
|
||||
|
||||
class ASTWalker: public Visitor
|
||||
@@ -344,7 +346,7 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
|
||||
connect(&d->m_outputParser, SIGNAL(waitingForConnectionViaOst()),
|
||||
this, SLOT(beginConnection()));
|
||||
connect(&d->m_outputParser, SIGNAL(noOutputMessage()),
|
||||
this, SLOT(beginConnection()));
|
||||
this, SLOT(tryToConnect()));
|
||||
connect(&d->m_outputParser, SIGNAL(errorMessage(QString)),
|
||||
this, SLOT(appStartupFailed(QString)));
|
||||
|
||||
@@ -352,7 +354,7 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
|
||||
// (application output might be redirected / blocked)
|
||||
d->m_noDebugOutputTimer.setSingleShot(true);
|
||||
d->m_noDebugOutputTimer.setInterval(8000);
|
||||
connect(&d->m_noDebugOutputTimer, SIGNAL(timeout()), this, SLOT(beginConnection()));
|
||||
connect(&d->m_noDebugOutputTimer, SIGNAL(timeout()), this, SLOT(tryToConnect()));
|
||||
|
||||
qtMessageLogHandler()->setHasEditableRow(true);
|
||||
|
||||
@@ -360,6 +362,9 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
|
||||
SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
|
||||
this,
|
||||
SLOT(documentUpdated(QmlJS::Document::Ptr)));
|
||||
|
||||
// we won't get any debug output
|
||||
d->m_retryOnConnectFail = startParameters.useTerminal;
|
||||
}
|
||||
|
||||
QmlEngine::~QmlEngine()
|
||||
@@ -409,6 +414,12 @@ void QmlEngine::connectionEstablished()
|
||||
notifyEngineRunAndInferiorRunOk();
|
||||
}
|
||||
|
||||
void QmlEngine::tryToConnect(quint16 port)
|
||||
{
|
||||
d->m_retryOnConnectFail = true;
|
||||
beginConnection(port);
|
||||
}
|
||||
|
||||
void QmlEngine::beginConnection(quint16 port)
|
||||
{
|
||||
d->m_noDebugOutputTimer.stop();
|
||||
@@ -443,6 +454,10 @@ void QmlEngine::connectionStartupFailed()
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (d->m_retryOnConnectFail) {
|
||||
beginConnection();
|
||||
return;
|
||||
}
|
||||
|
||||
QMessageBox *infoBox = new QMessageBox(Core::ICore::mainWindow());
|
||||
infoBox->setIcon(QMessageBox::Critical);
|
||||
@@ -584,6 +599,8 @@ void QmlEngine::runEngine()
|
||||
beginConnection();
|
||||
else
|
||||
startApplicationLauncher();
|
||||
} else {
|
||||
d->m_noDebugOutputTimer.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -161,6 +161,7 @@ signals:
|
||||
TextEditor::ITextEditor *editor, int cursorPos);
|
||||
|
||||
private slots:
|
||||
void tryToConnect(quint16 port = 0);
|
||||
void beginConnection(quint16 port = 0);
|
||||
void connectionEstablished();
|
||||
void connectionStartupFailed();
|
||||
|
Reference in New Issue
Block a user