forked from qt-creator/qt-creator
RemoteLinux: Use QTC_ASSERT instead of idiosyncratic macros.
Change-Id: I57393197d87d54c4b08f457e1dd50d0cbcfaa1f0 Reviewed-on: http://codereview.qt.nokia.com/1872 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
@@ -30,10 +30,11 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "maemodebugsupport.h"
|
#include "maemodebugsupport.h"
|
||||||
|
|
||||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
#include "maemorunconfiguration.h"
|
||||||
|
|
||||||
#include "maemosshrunner.h"
|
#include "maemosshrunner.h"
|
||||||
|
|
||||||
|
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,9 @@
|
|||||||
#include "maemousedportsgatherer.h"
|
#include "maemousedportsgatherer.h"
|
||||||
|
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/ssh/sshconnection.h>
|
#include <utils/ssh/sshconnection.h>
|
||||||
|
|
||||||
#define ASSERT_STATE(state) ASSERT_STATE_GENERIC(State, state, m_state)
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ void MaemoDeploymentMounter::setupMounts(const SshConnection::Ptr &connection,
|
|||||||
const QList<MaemoMountSpecification> &mountSpecs,
|
const QList<MaemoMountSpecification> &mountSpecs,
|
||||||
const Qt4BuildConfiguration *bc)
|
const Qt4BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
m_mountSpecs = mountSpecs;
|
m_mountSpecs = mountSpecs;
|
||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
@@ -89,7 +88,7 @@ void MaemoDeploymentMounter::setupMounts(const SshConnection::Ptr &connection,
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::tearDownMounts()
|
void MaemoDeploymentMounter::tearDownMounts()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Mounted);
|
QTC_ASSERT(m_state == Mounted, return);
|
||||||
|
|
||||||
setState(UnmountingCurrentMounts);
|
setState(UnmountingCurrentMounts);
|
||||||
unmount();
|
unmount();
|
||||||
@@ -97,7 +96,8 @@ void MaemoDeploymentMounter::tearDownMounts()
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::setupMounter()
|
void MaemoDeploymentMounter::setupMounter()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(UnmountingOldDirs);
|
QTC_ASSERT(m_state == UnmountingOldDirs, return);
|
||||||
|
|
||||||
setState(UnmountingCurrentDirs);
|
setState(UnmountingCurrentDirs);
|
||||||
|
|
||||||
m_mounter->resetMountSpecifications();
|
m_mounter->resetMountSpecifications();
|
||||||
@@ -109,8 +109,8 @@ void MaemoDeploymentMounter::setupMounter()
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::unmount()
|
void MaemoDeploymentMounter::unmount()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << UnmountingOldDirs << UnmountingCurrentDirs
|
QTC_ASSERT(m_state == UnmountingOldDirs || m_state == UnmountingCurrentDirs
|
||||||
<< UnmountingCurrentMounts);
|
|| m_state == UnmountingCurrentMounts, return);
|
||||||
|
|
||||||
if (m_mounter->hasValidMountSpecifications())
|
if (m_mounter->hasValidMountSpecifications())
|
||||||
m_mounter->unmount();
|
m_mounter->unmount();
|
||||||
@@ -120,7 +120,7 @@ void MaemoDeploymentMounter::unmount()
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::handleMounted()
|
void MaemoDeploymentMounter::handleMounted()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << Mounting << Inactive);
|
QTC_ASSERT(m_state == Mounting || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
@@ -131,8 +131,8 @@ void MaemoDeploymentMounter::handleMounted()
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::handleUnmounted()
|
void MaemoDeploymentMounter::handleUnmounted()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << UnmountingOldDirs << UnmountingCurrentDirs
|
QTC_ASSERT(m_state == UnmountingOldDirs || m_state == UnmountingCurrentDirs
|
||||||
<< UnmountingCurrentMounts << Inactive);
|
|| m_state == UnmountingCurrentMounts || m_state == Inactive, return);
|
||||||
|
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
case UnmountingOldDirs:
|
case UnmountingOldDirs:
|
||||||
@@ -154,7 +154,8 @@ void MaemoDeploymentMounter::handleUnmounted()
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::handlePortsGathererError(const QString &errorMsg)
|
void MaemoDeploymentMounter::handlePortsGathererError(const QString &errorMsg)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << GatheringPorts << Inactive);
|
QTC_ASSERT(m_state == GatheringPorts || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -165,7 +166,8 @@ void MaemoDeploymentMounter::handlePortsGathererError(const QString &errorMsg)
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::handlePortListReady()
|
void MaemoDeploymentMounter::handlePortListReady()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << GatheringPorts << Inactive);
|
QTC_ASSERT(m_state == GatheringPorts || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -176,8 +178,10 @@ void MaemoDeploymentMounter::handlePortListReady()
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::handleMountError(const QString &errorMsg)
|
void MaemoDeploymentMounter::handleMountError(const QString &errorMsg)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << UnmountingOldDirs << UnmountingCurrentDirs
|
QTC_ASSERT(m_state == UnmountingOldDirs || m_state == UnmountingCurrentDirs
|
||||||
<< UnmountingCurrentMounts << Mounting << Mounted << Inactive);
|
|| m_state == UnmountingCurrentMounts || m_state == Mounting || m_state == Mounted
|
||||||
|
|| m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,6 @@
|
|||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
|
|
||||||
#define ASSERT_STATE_GENERIC(State, expected, actual) \
|
|
||||||
MaemoGlobal::assertState<State>(expected, actual, Q_FUNC_INFO)
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QProcess;
|
class QProcess;
|
||||||
class QString;
|
class QString;
|
||||||
@@ -149,21 +146,6 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename State> static void assertState(State expected,
|
|
||||||
State actual, const char *func)
|
|
||||||
{
|
|
||||||
assertState(QList<State>() << expected, actual, func);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename State> static void assertState(const QList<State> &expected,
|
|
||||||
State actual, const char *func)
|
|
||||||
{
|
|
||||||
if (!expected.contains(actual)) {
|
|
||||||
qWarning("Warning: Unexpected state %d in function %s.",
|
|
||||||
actual, func);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool isValidMaemoQtVersion(const QString &qmakePath, const QString &osType);
|
static bool isValidMaemoQtVersion(const QString &qmakePath, const QString &osType);
|
||||||
private:
|
private:
|
||||||
static QString madAdminCommand(const QString &qmakePath);
|
static QString madAdminCommand(const QString &qmakePath);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
@@ -53,8 +54,6 @@
|
|||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
|
|
||||||
#define ASSERT_STATE(state) ASSERT_STATE_GENERIC(State, state, m_state)
|
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -85,7 +84,7 @@ MaemoPublisherFremantleFree::MaemoPublisherFremantleFree(const ProjectExplorer::
|
|||||||
|
|
||||||
MaemoPublisherFremantleFree::~MaemoPublisherFremantleFree()
|
MaemoPublisherFremantleFree::~MaemoPublisherFremantleFree()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
m_process->kill();
|
m_process->kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,8 +290,8 @@ void MaemoPublisherFremantleFree::handleProcessStdErr()
|
|||||||
|
|
||||||
void MaemoPublisherFremantleFree::handleProcessFinished(bool failedToStart)
|
void MaemoPublisherFremantleFree::handleProcessFinished(bool failedToStart)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << RunningQmake << RunningMakeDistclean
|
QTC_ASSERT(m_state == RunningQmake || m_state == RunningMakeDistclean
|
||||||
<< BuildingPackage << Inactive);
|
|| m_state == BuildingPackage || m_state == Inactive, return);
|
||||||
|
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
case RunningQmake:
|
case RunningQmake:
|
||||||
@@ -399,7 +398,7 @@ void MaemoPublisherFremantleFree::uploadPackage()
|
|||||||
|
|
||||||
void MaemoPublisherFremantleFree::handleScpStarted()
|
void MaemoPublisherFremantleFree::handleScpStarted()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << StartingScp << Inactive);
|
QTC_ASSERT(m_state == StartingScp || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == StartingScp)
|
if (m_state == StartingScp)
|
||||||
prepareToSendFile();
|
prepareToSendFile();
|
||||||
@@ -415,8 +414,8 @@ void MaemoPublisherFremantleFree::handleConnectionError()
|
|||||||
|
|
||||||
void MaemoPublisherFremantleFree::handleUploadJobFinished(int exitStatus)
|
void MaemoPublisherFremantleFree::handleUploadJobFinished(int exitStatus)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << PreparingToUploadFile << UploadingFile
|
QTC_ASSERT(m_state == PreparingToUploadFile || m_state == UploadingFile || m_state ==Inactive,
|
||||||
<< Inactive);
|
return);
|
||||||
|
|
||||||
if (m_state != Inactive && (exitStatus != SshRemoteProcess::ExitedNormally
|
if (m_state != Inactive && (exitStatus != SshRemoteProcess::ExitedNormally
|
||||||
|| m_uploader->process()->exitCode() != 0)) {
|
|| m_uploader->process()->exitCode() != 0)) {
|
||||||
@@ -484,8 +483,8 @@ void MaemoPublisherFremantleFree::sendFile()
|
|||||||
|
|
||||||
void MaemoPublisherFremantleFree::handleScpStdOut(const QByteArray &output)
|
void MaemoPublisherFremantleFree::handleScpStdOut(const QByteArray &output)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << PreparingToUploadFile << UploadingFile
|
QTC_ASSERT(m_state == PreparingToUploadFile || m_state == UploadingFile || m_state == Inactive,
|
||||||
<< Inactive);
|
return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -44,8 +44,6 @@
|
|||||||
|
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
|
|
||||||
#define ASSERT_STATE(state) ASSERT_STATE_GENERIC(State, state, m_state)
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -68,14 +66,16 @@ MaemoRemoteMounter::~MaemoRemoteMounter()
|
|||||||
void MaemoRemoteMounter::setConnection(const SshConnection::Ptr &connection,
|
void MaemoRemoteMounter::setConnection(const SshConnection::Ptr &connection,
|
||||||
const LinuxDeviceConfiguration::ConstPtr &devConf)
|
const LinuxDeviceConfiguration::ConstPtr &devConf)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
m_devConf = devConf;
|
m_devConf = devConf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
|
void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
const QtSupport::BaseQtVersion * const qtVersion = bc->qtVersion();
|
const QtSupport::BaseQtVersion * const qtVersion = bc->qtVersion();
|
||||||
const AbstractQt4MaemoTarget * const maemoTarget
|
const AbstractQt4MaemoTarget * const maemoTarget
|
||||||
= qobject_cast<AbstractQt4MaemoTarget *>(bc->target());
|
= qobject_cast<AbstractQt4MaemoTarget *>(bc->target());
|
||||||
@@ -86,7 +86,7 @@ void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
|
|||||||
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
|
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
|
||||||
bool mountAsRoot)
|
bool mountAsRoot)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_remoteMountsAllowed && mountSpec.isValid())
|
if (m_remoteMountsAllowed && mountSpec.isValid())
|
||||||
m_mountSpecs << MountInfo(mountSpec, mountAsRoot);
|
m_mountSpecs << MountInfo(mountSpec, mountAsRoot);
|
||||||
@@ -100,7 +100,8 @@ bool MaemoRemoteMounter::hasValidMountSpecifications() const
|
|||||||
void MaemoRemoteMounter::mount(PortList *freePorts,
|
void MaemoRemoteMounter::mount(PortList *freePorts,
|
||||||
const MaemoUsedPortsGatherer *portsGatherer)
|
const MaemoUsedPortsGatherer *portsGatherer)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
Q_ASSERT(m_utfsServers.isEmpty());
|
Q_ASSERT(m_utfsServers.isEmpty());
|
||||||
Q_ASSERT(m_connection);
|
Q_ASSERT(m_connection);
|
||||||
|
|
||||||
@@ -117,7 +118,7 @@ void MaemoRemoteMounter::mount(PortList *freePorts,
|
|||||||
|
|
||||||
void MaemoRemoteMounter::unmount()
|
void MaemoRemoteMounter::unmount()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_mountSpecs.isEmpty()) {
|
if (m_mountSpecs.isEmpty()) {
|
||||||
emit reportProgress(tr("No directories to unmount"));
|
emit reportProgress(tr("No directories to unmount"));
|
||||||
@@ -145,7 +146,7 @@ void MaemoRemoteMounter::unmount()
|
|||||||
|
|
||||||
void MaemoRemoteMounter::handleUnmountProcessFinished(int exitStatus)
|
void MaemoRemoteMounter::handleUnmountProcessFinished(int exitStatus)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << Unmounting << Inactive);
|
QTC_ASSERT(m_state == Unmounting || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
@@ -241,7 +242,8 @@ void MaemoRemoteMounter::startUtfsClients()
|
|||||||
|
|
||||||
void MaemoRemoteMounter::handleUtfsClientsStarted()
|
void MaemoRemoteMounter::handleUtfsClientsStarted()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << UtfsClientsStarting << Inactive);
|
QTC_ASSERT(m_state == UtfsClientsStarting || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == UtfsClientsStarting) {
|
if (m_state == UtfsClientsStarting) {
|
||||||
setState(UtfsClientsStarted);
|
setState(UtfsClientsStarted);
|
||||||
QTimer::singleShot(250, this, SLOT(startUtfsServers()));
|
QTimer::singleShot(250, this, SLOT(startUtfsServers()));
|
||||||
@@ -250,8 +252,8 @@ void MaemoRemoteMounter::handleUtfsClientsStarted()
|
|||||||
|
|
||||||
void MaemoRemoteMounter::handleUtfsClientsFinished(int exitStatus)
|
void MaemoRemoteMounter::handleUtfsClientsFinished(int exitStatus)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << UtfsClientsStarting << UtfsClientsStarted
|
QTC_ASSERT(m_state == UtfsClientsStarting || m_state == UtfsClientsStarted
|
||||||
<< UtfsServersStarted << Inactive);
|
|| m_state == UtfsServersStarted || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
@@ -273,7 +275,7 @@ void MaemoRemoteMounter::handleUtfsClientsFinished(int exitStatus)
|
|||||||
|
|
||||||
void MaemoRemoteMounter::startUtfsServers()
|
void MaemoRemoteMounter::startUtfsServers()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << UtfsClientsStarted << Inactive);
|
QTC_ASSERT(m_state == UtfsClientsStarted || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
@@ -378,7 +380,8 @@ void MaemoRemoteMounter::killUtfsServer(QProcess *proc)
|
|||||||
|
|
||||||
void MaemoRemoteMounter::handleUtfsServerTimeout()
|
void MaemoRemoteMounter::handleUtfsServerTimeout()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << UtfsServersStarted << Inactive);
|
QTC_ASSERT(m_state == UtfsServersStarted || m_state == Inactive, return);
|
||||||
|
|
||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -31,17 +31,15 @@
|
|||||||
|
|
||||||
#include "maemosshrunner.h"
|
#include "maemosshrunner.h"
|
||||||
|
|
||||||
#include "maemoglobal.h"
|
|
||||||
#include "maemoqemumanager.h"
|
#include "maemoqemumanager.h"
|
||||||
#include "maemoremotemounter.h"
|
#include "maemoremotemounter.h"
|
||||||
#include "maemoremotemountsmodel.h"
|
#include "maemoremotemountsmodel.h"
|
||||||
#include "remotelinuxrunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
|
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
|
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#define ASSERT_STATE(state) ASSERT_STATE_GENERIC(MountState, state, m_mountState)
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -93,12 +91,13 @@ bool MaemoSshRunner::canRun(QString &whyNot) const
|
|||||||
void MaemoSshRunner::doDeviceSetup()
|
void MaemoSshRunner::doDeviceSetup()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_mountState == InactiveMountState, return);
|
QTC_ASSERT(m_mountState == InactiveMountState, return);
|
||||||
|
|
||||||
handleDeviceSetupDone(true);
|
handleDeviceSetupDone(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoSshRunner::doAdditionalInitialCleanup()
|
void MaemoSshRunner::doAdditionalInitialCleanup()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(InactiveMountState);
|
QTC_ASSERT(m_mountState == InactiveMountState, return);
|
||||||
|
|
||||||
m_mounter->setConnection(connection(), devConfig());
|
m_mounter->setConnection(connection(), devConfig());
|
||||||
m_mounter->resetMountSpecifications();
|
m_mounter->resetMountSpecifications();
|
||||||
@@ -115,14 +114,15 @@ void MaemoSshRunner::doAdditionalInitializations()
|
|||||||
|
|
||||||
void MaemoSshRunner::doPostRunCleanup()
|
void MaemoSshRunner::doPostRunCleanup()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Mounted);
|
QTC_ASSERT(m_mountState == Mounted, return);
|
||||||
|
|
||||||
m_mountState = PostRunUnmounting;
|
m_mountState = PostRunUnmounting;
|
||||||
unmount();
|
unmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoSshRunner::handleUnmounted()
|
void MaemoSshRunner::handleUnmounted()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<MountState>() << InitialUnmounting << PostRunUnmounting);
|
QTC_ASSERT(m_mountState == InitialUnmounting || m_mountState == PostRunUnmounting, return);
|
||||||
|
|
||||||
switch (m_mountState) {
|
switch (m_mountState) {
|
||||||
case InitialUnmounting:
|
case InitialUnmounting:
|
||||||
@@ -146,7 +146,7 @@ void MaemoSshRunner::doAdditionalConnectionErrorHandling()
|
|||||||
|
|
||||||
void MaemoSshRunner::handleMounted()
|
void MaemoSshRunner::handleMounted()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Mounting);
|
QTC_ASSERT(m_mountState == Mounting, return);
|
||||||
|
|
||||||
if (m_mountState == Mounting) {
|
if (m_mountState == Mounting) {
|
||||||
m_mountState = Mounted;
|
m_mountState = Mounted;
|
||||||
@@ -156,7 +156,8 @@ void MaemoSshRunner::handleMounted()
|
|||||||
|
|
||||||
void MaemoSshRunner::handleMounterError(const QString &errorMsg)
|
void MaemoSshRunner::handleMounterError(const QString &errorMsg)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<MountState>() << InitialUnmounting << Mounting << PostRunUnmounting);
|
QTC_ASSERT(m_mountState == InitialUnmounting || m_mountState == Mounting
|
||||||
|
|| m_mountState == PostRunUnmounting, return);
|
||||||
|
|
||||||
const MountState oldMountState = m_mountState;
|
const MountState oldMountState = m_mountState;
|
||||||
m_mountState = InactiveMountState;
|
m_mountState = InactiveMountState;
|
||||||
@@ -189,7 +190,8 @@ void MaemoSshRunner::mount()
|
|||||||
|
|
||||||
void MaemoSshRunner::unmount()
|
void MaemoSshRunner::unmount()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<MountState>() << InitialUnmounting << PostRunUnmounting);
|
QTC_ASSERT(m_mountState == InitialUnmounting || m_mountState == PostRunUnmounting, return);
|
||||||
|
|
||||||
if (m_mounter->hasValidMountSpecifications()) {
|
if (m_mounter->hasValidMountSpecifications()) {
|
||||||
QString message;
|
QString message;
|
||||||
switch (m_mountState) {
|
switch (m_mountState) {
|
||||||
|
|||||||
@@ -34,11 +34,11 @@
|
|||||||
|
|
||||||
#include "remotelinuxapplicationrunner.h"
|
#include "remotelinuxapplicationrunner.h"
|
||||||
#include "maemomountspecification.h"
|
#include "maemomountspecification.h"
|
||||||
#include "maemorunconfiguration.h"
|
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class MaemoRemoteMounter;
|
class MaemoRemoteMounter;
|
||||||
|
class MaemoRunConfiguration;
|
||||||
|
|
||||||
class MaemoSshRunner : public AbstractRemoteLinuxApplicationRunner
|
class MaemoSshRunner : public AbstractRemoteLinuxApplicationRunner
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include "remotelinuxdebugsupport.h"
|
#include "remotelinuxdebugsupport.h"
|
||||||
|
|
||||||
#include "maemoglobal.h"
|
#include "linuxdeviceconfiguration.h"
|
||||||
#include "maemousedportsgatherer.h"
|
#include "maemousedportsgatherer.h"
|
||||||
#include "qt4maemotarget.h"
|
#include "qt4maemotarget.h"
|
||||||
#include "remotelinuxapplicationrunner.h"
|
#include "remotelinuxapplicationrunner.h"
|
||||||
@@ -40,8 +40,7 @@
|
|||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
#define ASSERT_STATE(state) ASSERT_STATE_GENERIC(State, state, m_state)
|
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
using namespace Debugger;
|
using namespace Debugger;
|
||||||
@@ -115,7 +114,7 @@ void AbstractRemoteLinuxDebugSupport::showMessage(const QString &msg, int channe
|
|||||||
|
|
||||||
void AbstractRemoteLinuxDebugSupport::handleAdapterSetupRequested()
|
void AbstractRemoteLinuxDebugSupport::handleAdapterSetupRequested()
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
setState(StartingRunner);
|
setState(StartingRunner);
|
||||||
showMessage(tr("Preparing remote side ...\n"), AppStuff);
|
showMessage(tr("Preparing remote side ...\n"), AppStuff);
|
||||||
@@ -142,7 +141,7 @@ void AbstractRemoteLinuxDebugSupport::startExecution()
|
|||||||
if (m_state == Inactive)
|
if (m_state == Inactive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ASSERT_STATE(StartingRunner);
|
QTC_ASSERT(m_state == StartingRunner, return);
|
||||||
|
|
||||||
if (m_debuggingType != RemoteLinuxRunConfiguration::DebugQmlOnly) {
|
if (m_debuggingType != RemoteLinuxRunConfiguration::DebugQmlOnly) {
|
||||||
if (!setPort(m_gdbServerPort))
|
if (!setPort(m_gdbServerPort))
|
||||||
@@ -206,13 +205,15 @@ void AbstractRemoteLinuxDebugSupport::handleDebuggingFinished()
|
|||||||
|
|
||||||
void AbstractRemoteLinuxDebugSupport::handleRemoteOutput(const QByteArray &output)
|
void AbstractRemoteLinuxDebugSupport::handleRemoteOutput(const QByteArray &output)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << Inactive << Debugging);
|
QTC_ASSERT(m_state == Inactive || m_state == Debugging, return);
|
||||||
|
|
||||||
showMessage(QString::fromUtf8(output), AppOutput);
|
showMessage(QString::fromUtf8(output), AppOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractRemoteLinuxDebugSupport::handleRemoteErrorOutput(const QByteArray &output)
|
void AbstractRemoteLinuxDebugSupport::handleRemoteErrorOutput(const QByteArray &output)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(QList<State>() << Inactive << StartingRemoteProcess << Debugging);
|
QTC_ASSERT(m_state == Inactive || m_state == StartingRemoteProcess || m_state == Debugging,
|
||||||
|
return);
|
||||||
|
|
||||||
if (!m_engine)
|
if (!m_engine)
|
||||||
return;
|
return;
|
||||||
@@ -248,7 +249,8 @@ void AbstractRemoteLinuxDebugSupport::handleAdapterSetupDone()
|
|||||||
void AbstractRemoteLinuxDebugSupport::handleRemoteProcessStarted()
|
void AbstractRemoteLinuxDebugSupport::handleRemoteProcessStarted()
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly);
|
Q_ASSERT(m_debuggingType == RemoteLinuxRunConfiguration::DebugQmlOnly);
|
||||||
ASSERT_STATE(StartingRemoteProcess);
|
QTC_ASSERT(m_state == StartingRemoteProcess, return);
|
||||||
|
|
||||||
handleAdapterSetupDone();
|
handleAdapterSetupDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user