forked from qt-creator/qt-creator
Debugger: Fix QmlInspector state update connection
Change-Id: I1693d593ec08c14c48b2c2800ce2f240f9e5f438 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1287,9 +1287,6 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
|
||||
showMessage(msg, LogDebug);
|
||||
updateViews();
|
||||
|
||||
QTC_ASSERT(runTool(), return);
|
||||
runTool()->stateChanged(d->m_state);
|
||||
|
||||
if (isSlaveEngine())
|
||||
masterEngine()->slaveEngineStateChanged(this, state);
|
||||
}
|
||||
|
||||
@@ -381,6 +381,8 @@ protected:
|
||||
void setRemoteParameters(const RemoteSetupResult &result);
|
||||
|
||||
protected:
|
||||
virtual void setState(DebuggerState state, bool forced = false);
|
||||
|
||||
virtual void notifyInferiorShutdownOk();
|
||||
virtual void notifyInferiorShutdownFailed();
|
||||
|
||||
@@ -457,8 +459,6 @@ private:
|
||||
friend class DebuggerPluginPrivate;
|
||||
friend class QmlAdapter;
|
||||
|
||||
virtual void setState(DebuggerState state, bool forced = false);
|
||||
|
||||
friend class DebuggerEnginePrivate;
|
||||
friend class LocationMark;
|
||||
DebuggerEnginePrivate *d;
|
||||
|
||||
@@ -88,7 +88,6 @@ public:
|
||||
void appendSolibSearchPath(const QString &str);
|
||||
|
||||
signals:
|
||||
void stateChanged(Debugger::DebuggerState state);
|
||||
void aboutToNotifyInferiorSetupOk();
|
||||
void requestRemoteSetup();
|
||||
|
||||
|
||||
@@ -347,6 +347,12 @@ QmlEngine::~QmlEngine()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void QmlEngine::setState(DebuggerState state, bool forced)
|
||||
{
|
||||
DebuggerEngine::setState(state, forced);
|
||||
updateCurrentContext();
|
||||
}
|
||||
|
||||
void QmlEngine::setRunTool(DebuggerRunTool *runTool)
|
||||
{
|
||||
DebuggerEngine::setRunTool(runTool);
|
||||
@@ -354,8 +360,6 @@ void QmlEngine::setRunTool(DebuggerRunTool *runTool)
|
||||
d->startupMessageFilterConnection = connect(
|
||||
runTool->runControl(), &RunControl::appendMessageRequested,
|
||||
d, &QmlEnginePrivate::filterApplicationMessage);
|
||||
connect(runTool, &DebuggerRunTool::stateChanged,
|
||||
this, &QmlEngine::updateCurrentContext);
|
||||
}
|
||||
|
||||
void QmlEngine::setupInferior()
|
||||
@@ -1142,6 +1146,8 @@ void QmlEngine::disconnected()
|
||||
|
||||
void QmlEngine::updateCurrentContext()
|
||||
{
|
||||
d->inspectorAgent.enableTools(state() == InferiorRunOk);
|
||||
|
||||
QString context;
|
||||
switch (state()) {
|
||||
case InferiorStopOk:
|
||||
|
||||
@@ -67,6 +67,8 @@ private:
|
||||
void appStartupFailed(const QString &errorMessage);
|
||||
void appMessage(const QString &msg, Utils::OutputFormat);
|
||||
|
||||
void setState(DebuggerState state, bool forced) override;
|
||||
|
||||
void notifyEngineRemoteServerRunning(const QString &, int pid) override;
|
||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
||||
|
||||
|
||||
@@ -94,8 +94,6 @@ QmlInspectorAgent::QmlInspectorAgent(QmlEngine *engine, QmlDebugConnection *conn
|
||||
|
||||
if (!m_masterEngine->isMasterEngine())
|
||||
m_masterEngine = m_masterEngine->masterEngine();
|
||||
connect(m_masterEngine->runTool(), &DebuggerRunTool::stateChanged,
|
||||
this, &QmlInspectorAgent::onEngineStateChanged);
|
||||
|
||||
auto engineClient1 = new DeclarativeEngineDebugClient(connection);
|
||||
connect(engineClient1, &BaseEngineDebugClient::newState,
|
||||
@@ -760,7 +758,7 @@ void QmlInspectorAgent::toolsClientStateChanged(QmlDebugClient::State state)
|
||||
Core::ICore::addAdditionalContext(m_inspectorToolsContext);
|
||||
|
||||
m_toolsClientConnected = true;
|
||||
onEngineStateChanged(m_masterEngine->state());
|
||||
enableTools(m_masterEngine->state() == InferiorRunOk);
|
||||
if (m_showAppOnTopAction->isChecked())
|
||||
m_toolsClient->showAppOnTop(true);
|
||||
|
||||
@@ -913,10 +911,5 @@ void QmlInspectorAgent::onReloaded()
|
||||
reloadEngines();
|
||||
}
|
||||
|
||||
void QmlInspectorAgent::onEngineStateChanged(const DebuggerState state)
|
||||
{
|
||||
enableTools(state == InferiorRunOk);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
void assignValue(const WatchItem *data, const QString &expression, const QVariant &valueV);
|
||||
void updateWatchData(const WatchItem &data);
|
||||
void watchDataSelected(qint64 id);
|
||||
void enableTools(bool enable);
|
||||
|
||||
private:
|
||||
bool selectObjectInTree(int debugId);
|
||||
@@ -96,8 +97,6 @@ private:
|
||||
bool isConnected() const;
|
||||
void clearObjectTree();
|
||||
|
||||
void onEngineStateChanged(const Debugger::DebuggerState);
|
||||
|
||||
void clientStateChanged(QmlDebug::QmlDebugClient::State state);
|
||||
void toolsClientStateChanged(QmlDebug::QmlDebugClient::State state);
|
||||
void engineClientStateChanged(QmlDebug::QmlDebugClient::State state);
|
||||
@@ -117,8 +116,6 @@ private:
|
||||
const QmlDebug::ObjectReference &objectReference,
|
||||
SelectionTarget target);
|
||||
|
||||
void enableTools(const bool enable);
|
||||
|
||||
private:
|
||||
QPointer<QmlEngine> m_qmlEngine;
|
||||
QmlDebug::BaseEngineDebugClient *m_engineClient;
|
||||
|
||||
Reference in New Issue
Block a user