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