forked from qt-creator/qt-creator
madde: prefer using Profile instead of qt4BuildConfiguration etc
Change-Id: I6fe64f7a4a5713c09ea02460a958758d0938fc19 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
@@ -199,8 +199,7 @@ void AbstractMaemoDeployByMountService::doDeploy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_state = Mounting;
|
m_state = Mounting;
|
||||||
m_mounter->setupMounts(connection(), deviceConfiguration(), mountSpecifications(),
|
m_mounter->setupMounts(connection(), deviceConfiguration(), mountSpecifications(), profile());
|
||||||
qt4BuildConfiguration());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractMaemoDeployByMountService::stopDeployment()
|
void AbstractMaemoDeployByMountService::stopDeployment()
|
||||||
|
@@ -34,14 +34,13 @@
|
|||||||
#include "maemoremotemounter.h"
|
#include "maemoremotemounter.h"
|
||||||
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtprofileinformation.h>
|
||||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||||
#include <remotelinux/remotelinuxusedportsgatherer.h>
|
#include <remotelinux/remotelinuxusedportsgatherer.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace ProjectExplorer;
|
||||||
using namespace RemoteLinux;
|
using namespace RemoteLinux;
|
||||||
using namespace QSsh;
|
using namespace QSsh;
|
||||||
|
|
||||||
@@ -73,7 +72,7 @@ MaemoDeploymentMounter::~MaemoDeploymentMounter() {}
|
|||||||
void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
|
void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
|
||||||
const LinuxDeviceConfiguration::ConstPtr &devConf,
|
const LinuxDeviceConfiguration::ConstPtr &devConf,
|
||||||
const QList<MaemoMountSpecification> &mountSpecs,
|
const QList<MaemoMountSpecification> &mountSpecs,
|
||||||
const Qt4BuildConfiguration *bc)
|
const Profile *profile)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_state == Inactive, return);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
@@ -81,7 +80,7 @@ void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
|
|||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
m_devConf = devConf;
|
m_devConf = devConf;
|
||||||
m_mounter->setConnection(m_connection, m_devConf);
|
m_mounter->setConnection(m_connection, m_devConf);
|
||||||
m_buildConfig = bc;
|
m_profile = profile;
|
||||||
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
|
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
|
||||||
setState(UnmountingOldDirs);
|
setState(UnmountingOldDirs);
|
||||||
unmount();
|
unmount();
|
||||||
@@ -102,7 +101,7 @@ void MaemoDeploymentMounter::setupMounter()
|
|||||||
setState(UnmountingCurrentDirs);
|
setState(UnmountingCurrentDirs);
|
||||||
|
|
||||||
m_mounter->resetMountSpecifications();
|
m_mounter->resetMountSpecifications();
|
||||||
m_mounter->setBuildConfiguration(m_buildConfig);
|
m_mounter->setProfile(m_profile);
|
||||||
foreach (const MaemoMountSpecification &mountSpec, m_mountSpecs)
|
foreach (const MaemoMountSpecification &mountSpec, m_mountSpecs)
|
||||||
m_mounter->addMountSpecification(mountSpec, true);
|
m_mounter->addMountSpecification(mountSpec, true);
|
||||||
unmount();
|
unmount();
|
||||||
@@ -173,7 +172,7 @@ void MaemoDeploymentMounter::handlePortListReady()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
setState(Mounting);
|
setState(Mounting);
|
||||||
m_freePorts = MaemoGlobal::freePorts(m_devConf, QtSupport::QtProfileInformation::qtVersion(m_buildConfig->target()->profile()));
|
m_freePorts = MaemoGlobal::freePorts(m_devConf, QtSupport::QtProfileInformation::qtVersion(m_profile));
|
||||||
m_mounter->mount(&m_freePorts, m_portsGatherer);
|
m_mounter->mount(&m_freePorts, m_portsGatherer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
namespace QSsh { class SshConnection; }
|
namespace QSsh { class SshConnection; }
|
||||||
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
|
namespace ProjectExplorer { class Profile; }
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
class LinuxDeviceConfiguration;
|
class LinuxDeviceConfiguration;
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
void setupMounts(QSsh::SshConnection *connection,
|
void setupMounts(QSsh::SshConnection *connection,
|
||||||
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
|
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
|
||||||
const QList<MaemoMountSpecification> &mountSpecs,
|
const QList<MaemoMountSpecification> &mountSpecs,
|
||||||
const Qt4ProjectManager::Qt4BuildConfiguration *bc);
|
const ProjectExplorer::Profile *profile);
|
||||||
void tearDownMounts();
|
void tearDownMounts();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -97,7 +97,7 @@ private:
|
|||||||
RemoteLinux::RemoteLinuxUsedPortsGatherer * const m_portsGatherer;
|
RemoteLinux::RemoteLinuxUsedPortsGatherer * const m_portsGatherer;
|
||||||
Utils::PortList m_freePorts;
|
Utils::PortList m_freePorts;
|
||||||
QList<MaemoMountSpecification> m_mountSpecs;
|
QList<MaemoMountSpecification> m_mountSpecs;
|
||||||
const Qt4ProjectManager::Qt4BuildConfiguration *m_buildConfig;
|
const ProjectExplorer::Profile *m_profile;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -37,9 +37,6 @@
|
|||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <ssh/sshremoteprocess.h>
|
#include <ssh/sshremoteprocess.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
|
||||||
#include <qtsupport/baseqtversion.h>
|
|
||||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
|
||||||
#include <remotelinux/remotelinuxusedportsgatherer.h>
|
#include <remotelinux/remotelinuxusedportsgatherer.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -47,7 +44,6 @@
|
|||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace QSsh;
|
using namespace QSsh;
|
||||||
using namespace Qt4ProjectManager;
|
|
||||||
using namespace RemoteLinux;
|
using namespace RemoteLinux;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -76,13 +72,13 @@ void MaemoRemoteMounter::setConnection(SshConnection *connection,
|
|||||||
m_devConf = devConf;
|
m_devConf = devConf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
|
void MaemoRemoteMounter::setProfile(const Profile *profile)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_state == Inactive, return);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
Core::Id typeId = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(bc->target()->profile());
|
Core::Id typeId = DeviceTypeProfileInformation::deviceTypeId(profile);
|
||||||
m_remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId);
|
m_remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId);
|
||||||
m_maddeRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(bc->target()->profile());
|
m_maddeRoot = SysRootProfileInformation::sysRoot(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
|
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
|
||||||
|
@@ -49,9 +49,9 @@ class SshConnection;
|
|||||||
class SshRemoteProcess;
|
class SshRemoteProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Utils { class PortList; }
|
namespace ProjectExplorer { class Profile; }
|
||||||
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
|
|
||||||
namespace RemoteLinux { class RemoteLinuxUsedPortsGatherer; }
|
namespace RemoteLinux { class RemoteLinuxUsedPortsGatherer; }
|
||||||
|
namespace Utils { class PortList; }
|
||||||
|
|
||||||
namespace Madde {
|
namespace Madde {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
void setConnection(QSsh::SshConnection *connection,
|
void setConnection(QSsh::SshConnection *connection,
|
||||||
const ProjectExplorer::IDevice::ConstPtr &devConf);
|
const ProjectExplorer::IDevice::ConstPtr &devConf);
|
||||||
|
|
||||||
void setBuildConfiguration(const Qt4ProjectManager::Qt4BuildConfiguration *bc);
|
void setProfile(const ProjectExplorer::Profile *profile);
|
||||||
void addMountSpecification(const MaemoMountSpecification &mountSpec,
|
void addMountSpecification(const MaemoMountSpecification &mountSpec,
|
||||||
bool mountAsRoot);
|
bool mountAsRoot);
|
||||||
bool hasValidMountSpecifications() const;
|
bool hasValidMountSpecifications() const;
|
||||||
|
@@ -40,6 +40,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
|
|
||||||
|
using namespace ProjectExplorer;
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace RemoteLinux;
|
using namespace RemoteLinux;
|
||||||
using namespace QSsh;
|
using namespace QSsh;
|
||||||
@@ -53,9 +54,10 @@ MaemoSshRunner::MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig
|
|||||||
m_mountSpecs(runConfig->remoteMounts()->mountSpecs()),
|
m_mountSpecs(runConfig->remoteMounts()->mountSpecs()),
|
||||||
m_mountState(InactiveMountState)
|
m_mountState(InactiveMountState)
|
||||||
{
|
{
|
||||||
const Qt4BuildConfiguration * const bc = runConfig->activeQt4BuildConfiguration();
|
const BuildConfiguration * const bc = runConfig->target()->activeBuildConfiguration();
|
||||||
m_qtId = bc ? QtSupport::QtProfileInformation::qtVersionId(bc->target()->profile()) : -1;
|
Profile *profile = bc ? bc->target()->profile() : 0;
|
||||||
m_mounter->setBuildConfiguration(bc);
|
m_qtId = QtSupport::QtProfileInformation::qtVersionId(profile);
|
||||||
|
m_mounter->setProfile(profile);
|
||||||
connect(m_mounter, SIGNAL(mounted()), this, SLOT(handleMounted()));
|
connect(m_mounter, SIGNAL(mounted()), this, SLOT(handleMounted()));
|
||||||
connect(m_mounter, SIGNAL(unmounted()), this, SLOT(handleUnmounted()));
|
connect(m_mounter, SIGNAL(unmounted()), this, SLOT(handleUnmounted()));
|
||||||
connect(m_mounter, SIGNAL(error(QString)), this,
|
connect(m_mounter, SIGNAL(error(QString)), this,
|
||||||
|
@@ -84,10 +84,11 @@ class AbstractRemoteLinuxDeployServicePrivate
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractRemoteLinuxDeployServicePrivate()
|
AbstractRemoteLinuxDeployServicePrivate()
|
||||||
: connection(0), state(Inactive), stopRequested(false) {}
|
: profile(0), connection(0), state(Inactive), stopRequested(false) {}
|
||||||
|
|
||||||
LinuxDeviceConfiguration::ConstPtr deviceConfiguration;
|
LinuxDeviceConfiguration::ConstPtr deviceConfiguration;
|
||||||
QPointer<Qt4BuildConfiguration> buildConfiguration;
|
QPointer<Qt4BuildConfiguration> buildConfiguration;
|
||||||
|
ProjectExplorer::Profile *profile;
|
||||||
SshConnection *connection;
|
SshConnection *connection;
|
||||||
State state;
|
State state;
|
||||||
bool stopRequested;
|
bool stopRequested;
|
||||||
@@ -113,6 +114,11 @@ const Qt4BuildConfiguration *AbstractRemoteLinuxDeployService::qt4BuildConfigura
|
|||||||
return d->buildConfiguration;
|
return d->buildConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ProjectExplorer::Profile *AbstractRemoteLinuxDeployService::profile() const
|
||||||
|
{
|
||||||
|
return d->profile;
|
||||||
|
}
|
||||||
|
|
||||||
LinuxDeviceConfiguration::ConstPtr AbstractRemoteLinuxDeployService::deviceConfiguration() const
|
LinuxDeviceConfiguration::ConstPtr AbstractRemoteLinuxDeployService::deviceConfiguration() const
|
||||||
{
|
{
|
||||||
return d->deviceConfiguration;
|
return d->deviceConfiguration;
|
||||||
@@ -128,10 +134,10 @@ void AbstractRemoteLinuxDeployService::saveDeploymentTimeStamp(const DeployableF
|
|||||||
if (!d->buildConfiguration)
|
if (!d->buildConfiguration)
|
||||||
return;
|
return;
|
||||||
const QtSupport::BaseQtVersion *const qtVersion
|
const QtSupport::BaseQtVersion *const qtVersion
|
||||||
= QtSupport::QtProfileInformation::qtVersion(d->buildConfiguration->target()->profile());
|
= QtSupport::QtProfileInformation::qtVersion(d->profile);
|
||||||
QString systemRoot;
|
QString systemRoot;
|
||||||
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->buildConfiguration->target()->profile()))
|
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->profile))
|
||||||
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->buildConfiguration->target()->profile()).toString();
|
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->profile).toString();
|
||||||
if (!qtVersion || !qtVersion->isValid())
|
if (!qtVersion || !qtVersion->isValid())
|
||||||
return;
|
return;
|
||||||
d->lastDeployed.insert(DeployParameters(deployableFile,
|
d->lastDeployed.insert(DeployParameters(deployableFile,
|
||||||
@@ -145,12 +151,12 @@ bool AbstractRemoteLinuxDeployService::hasChangedSinceLastDeployment(const Deplo
|
|||||||
if (!d->buildConfiguration)
|
if (!d->buildConfiguration)
|
||||||
return true;
|
return true;
|
||||||
const QtSupport::BaseQtVersion *const qtVersion
|
const QtSupport::BaseQtVersion *const qtVersion
|
||||||
= QtSupport::QtProfileInformation::qtVersion(d->buildConfiguration->target()->profile());
|
= QtSupport::QtProfileInformation::qtVersion(d->profile);
|
||||||
if (!qtVersion || !qtVersion->isValid())
|
if (!qtVersion || !qtVersion->isValid())
|
||||||
return true;
|
return true;
|
||||||
QString systemRoot;
|
QString systemRoot;
|
||||||
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->buildConfiguration->target()->profile()))
|
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->profile))
|
||||||
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->buildConfiguration->target()->profile()).toString();
|
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->profile).toString();
|
||||||
const QDateTime &lastDeployed = d->lastDeployed.value(DeployParameters(deployableFile,
|
const QDateTime &lastDeployed = d->lastDeployed.value(DeployParameters(deployableFile,
|
||||||
deviceConfiguration()->sshParameters().host, systemRoot));
|
deviceConfiguration()->sshParameters().host, systemRoot));
|
||||||
return !lastDeployed.isValid()
|
return !lastDeployed.isValid()
|
||||||
@@ -165,6 +171,10 @@ void AbstractRemoteLinuxDeployService::setDeviceConfiguration(const LinuxDeviceC
|
|||||||
void AbstractRemoteLinuxDeployService::setBuildConfiguration(Qt4BuildConfiguration *bc)
|
void AbstractRemoteLinuxDeployService::setBuildConfiguration(Qt4BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
d->buildConfiguration = bc;
|
d->buildConfiguration = bc;
|
||||||
|
if (bc && bc->target())
|
||||||
|
d->profile = bc->target()->profile();
|
||||||
|
else
|
||||||
|
d->profile = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractRemoteLinuxDeployService::start()
|
void AbstractRemoteLinuxDeployService::start()
|
||||||
|
@@ -35,13 +35,10 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
QT_FORWARD_DECLARE_CLASS(QString)
|
|
||||||
|
|
||||||
namespace QSsh { class SshConnection; }
|
namespace QSsh { class SshConnection; }
|
||||||
|
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
|
||||||
namespace Qt4ProjectManager {
|
namespace ProjectExplorer { class Profile; }
|
||||||
class Qt4BuildConfiguration;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
class DeployableFile;
|
class DeployableFile;
|
||||||
@@ -79,6 +76,7 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
const Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
const Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
||||||
|
const ProjectExplorer::Profile *profile() const;
|
||||||
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
|
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
|
||||||
QSsh::SshConnection *connection() const;
|
QSsh::SshConnection *connection() const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user