From 26808a4bebf6866587f8861a463e052d2e37b74b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 6 Oct 2010 15:51:13 +0200 Subject: [PATCH] Maemo: State machine bugfixes in remote process execution. Reviewed-by: kh1 --- src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp index bc7989abd3..15d1f432e4 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp @@ -126,7 +126,7 @@ void MaemoSshRunner::handleConnected() void MaemoSshRunner::handleConnectionFailure() { - if (m_state != Inactive) + if (m_state == Inactive) qWarning("Unexpected state %d in %s.", m_state, Q_FUNC_INFO); const QString errorTemplate = m_state == Connecting @@ -165,8 +165,10 @@ void MaemoSshRunner::handleCleanupFinished(int exitStatus) || exitStatus == SshRemoteProcess::ExitedNormally); ASSERT_STATE(QList() << PreRunCleaning << PostRunCleaning - << StopRequested); + << StopRequested << Inactive); + if (m_state == Inactive) + return; if (m_state == StopRequested || m_state == PostRunCleaning) { unmount(); return; @@ -247,7 +249,7 @@ void MaemoSshRunner::handleMounted() void MaemoSshRunner::handleMounterError(const QString &errorMsg) { ASSERT_STATE(QList() << PreRunCleaning << PostRunCleaning - << PreMountUnmounting << Mounting << StopRequested); + << PreMountUnmounting << Mounting << StopRequested << Inactive); emitError(errorMsg); } @@ -279,10 +281,10 @@ void MaemoSshRunner::handleRemoteProcessFinished(int exitStatus) Q_ASSERT(exitStatus == SshRemoteProcess::FailedToStart || exitStatus == SshRemoteProcess::KilledBySignal || exitStatus == SshRemoteProcess::ExitedNormally); - ASSERT_STATE(QList() << ProcessStarting << StopRequested); + ASSERT_STATE(QList() << ProcessStarting << StopRequested << Inactive); m_exitStatus = exitStatus; - if (m_state != StopRequested) { + if (m_state != StopRequested && m_state != Inactive) { setState(PostRunCleaning); cleanup(); } -- 2.11.0