Commit 0fcd30cc authored by hjk's avatar hjk Committed by Christian Kandeler
Browse files

madde: prefer using Profile instead of qt4BuildConfiguration etc



Change-Id: I6fe64f7a4a5713c09ea02460a958758d0938fc19
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent 1bbcfd17
......@@ -199,8 +199,7 @@ void AbstractMaemoDeployByMountService::doDeploy()
}
m_state = Mounting;
m_mounter->setupMounts(connection(), deviceConfiguration(), mountSpecifications(),
qt4BuildConfiguration());
m_mounter->setupMounts(connection(), deviceConfiguration(), mountSpecifications(), profile());
}
void AbstractMaemoDeployByMountService::stopDeployment()
......
......@@ -34,14 +34,13 @@
#include "maemoremotemounter.h"
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/qtprofileinformation.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <remotelinux/remotelinuxusedportsgatherer.h>
#include <utils/qtcassert.h>
#include <ssh/sshconnection.h>
using namespace Qt4ProjectManager;
using namespace ProjectExplorer;
using namespace RemoteLinux;
using namespace QSsh;
......@@ -73,7 +72,7 @@ MaemoDeploymentMounter::~MaemoDeploymentMounter() {}
void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
const LinuxDeviceConfiguration::ConstPtr &devConf,
const QList<MaemoMountSpecification> &mountSpecs,
const Qt4BuildConfiguration *bc)
const Profile *profile)
{
QTC_ASSERT(m_state == Inactive, return);
......@@ -81,7 +80,7 @@ void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
m_connection = connection;
m_devConf = devConf;
m_mounter->setConnection(m_connection, m_devConf);
m_buildConfig = bc;
m_profile = profile;
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
setState(UnmountingOldDirs);
unmount();
......@@ -102,7 +101,7 @@ void MaemoDeploymentMounter::setupMounter()
setState(UnmountingCurrentDirs);
m_mounter->resetMountSpecifications();
m_mounter->setBuildConfiguration(m_buildConfig);
m_mounter->setProfile(m_profile);
foreach (const MaemoMountSpecification &mountSpec, m_mountSpecs)
m_mounter->addMountSpecification(mountSpec, true);
unmount();
......@@ -173,7 +172,7 @@ void MaemoDeploymentMounter::handlePortListReady()
return;
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);
}
......
......@@ -40,7 +40,7 @@
#include <QSharedPointer>
namespace QSsh { class SshConnection; }
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace ProjectExplorer { class Profile; }
namespace RemoteLinux {
class LinuxDeviceConfiguration;
......@@ -62,7 +62,7 @@ public:
void setupMounts(QSsh::SshConnection *connection,
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
const QList<MaemoMountSpecification> &mountSpecs,
const Qt4ProjectManager::Qt4BuildConfiguration *bc);
const ProjectExplorer::Profile *profile);
void tearDownMounts();
signals:
......@@ -97,7 +97,7 @@ private:
RemoteLinux::RemoteLinuxUsedPortsGatherer * const m_portsGatherer;
Utils::PortList m_freePorts;
QList<MaemoMountSpecification> m_mountSpecs;
const Qt4ProjectManager::Qt4BuildConfiguration *m_buildConfig;
const ProjectExplorer::Profile *m_profile;
};
} // namespace Internal
......
......@@ -37,9 +37,6 @@
#include <projectexplorer/target.h>
#include <ssh/sshconnection.h>
#include <ssh/sshremoteprocess.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/baseqtversion.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <remotelinux/remotelinuxusedportsgatherer.h>
#include <utils/qtcassert.h>
......@@ -47,7 +44,6 @@
using namespace ProjectExplorer;
using namespace QSsh;
using namespace Qt4ProjectManager;
using namespace RemoteLinux;
using namespace Utils;
......@@ -76,13 +72,13 @@ void MaemoRemoteMounter::setConnection(SshConnection *connection,
m_devConf = devConf;
}
void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
void MaemoRemoteMounter::setProfile(const Profile *profile)
{
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_maddeRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(bc->target()->profile());
m_maddeRoot = SysRootProfileInformation::sysRoot(profile);
}
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
......
......@@ -49,9 +49,9 @@ class SshConnection;
class SshRemoteProcess;
}
namespace Utils { class PortList; }
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace ProjectExplorer { class Profile; }
namespace RemoteLinux { class RemoteLinuxUsedPortsGatherer; }
namespace Utils { class PortList; }
namespace Madde {
namespace Internal {
......@@ -67,7 +67,7 @@ public:
void setConnection(QSsh::SshConnection *connection,
const ProjectExplorer::IDevice::ConstPtr &devConf);
void setBuildConfiguration(const Qt4ProjectManager::Qt4BuildConfiguration *bc);
void setProfile(const ProjectExplorer::Profile *profile);
void addMountSpecification(const MaemoMountSpecification &mountSpec,
bool mountAsRoot);
bool hasValidMountSpecifications() const;
......
......@@ -40,6 +40,7 @@
#include <utils/qtcassert.h>
#include <ssh/sshconnection.h>
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace RemoteLinux;
using namespace QSsh;
......@@ -53,9 +54,10 @@ MaemoSshRunner::MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig
m_mountSpecs(runConfig->remoteMounts()->mountSpecs()),
m_mountState(InactiveMountState)
{
const Qt4BuildConfiguration * const bc = runConfig->activeQt4BuildConfiguration();
m_qtId = bc ? QtSupport::QtProfileInformation::qtVersionId(bc->target()->profile()) : -1;
m_mounter->setBuildConfiguration(bc);
const BuildConfiguration * const bc = runConfig->target()->activeBuildConfiguration();
Profile *profile = bc ? bc->target()->profile() : 0;
m_qtId = QtSupport::QtProfileInformation::qtVersionId(profile);
m_mounter->setProfile(profile);
connect(m_mounter, SIGNAL(mounted()), this, SLOT(handleMounted()));
connect(m_mounter, SIGNAL(unmounted()), this, SLOT(handleUnmounted()));
connect(m_mounter, SIGNAL(error(QString)), this,
......
......@@ -84,10 +84,11 @@ class AbstractRemoteLinuxDeployServicePrivate
{
public:
AbstractRemoteLinuxDeployServicePrivate()
: connection(0), state(Inactive), stopRequested(false) {}
: profile(0), connection(0), state(Inactive), stopRequested(false) {}
LinuxDeviceConfiguration::ConstPtr deviceConfiguration;
QPointer<Qt4BuildConfiguration> buildConfiguration;
ProjectExplorer::Profile *profile;
SshConnection *connection;
State state;
bool stopRequested;
......@@ -113,6 +114,11 @@ const Qt4BuildConfiguration *AbstractRemoteLinuxDeployService::qt4BuildConfigura
return d->buildConfiguration;
}
const ProjectExplorer::Profile *AbstractRemoteLinuxDeployService::profile() const
{
return d->profile;
}
LinuxDeviceConfiguration::ConstPtr AbstractRemoteLinuxDeployService::deviceConfiguration() const
{
return d->deviceConfiguration;
......@@ -128,10 +134,10 @@ void AbstractRemoteLinuxDeployService::saveDeploymentTimeStamp(const DeployableF
if (!d->buildConfiguration)
return;
const QtSupport::BaseQtVersion *const qtVersion
= QtSupport::QtProfileInformation::qtVersion(d->buildConfiguration->target()->profile());
= QtSupport::QtProfileInformation::qtVersion(d->profile);
QString systemRoot;
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->buildConfiguration->target()->profile()))
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->buildConfiguration->target()->profile()).toString();
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->profile))
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->profile).toString();
if (!qtVersion || !qtVersion->isValid())
return;
d->lastDeployed.insert(DeployParameters(deployableFile,
......@@ -145,12 +151,12 @@ bool AbstractRemoteLinuxDeployService::hasChangedSinceLastDeployment(const Deplo
if (!d->buildConfiguration)
return true;
const QtSupport::BaseQtVersion *const qtVersion
= QtSupport::QtProfileInformation::qtVersion(d->buildConfiguration->target()->profile());
= QtSupport::QtProfileInformation::qtVersion(d->profile);
if (!qtVersion || !qtVersion->isValid())
return true;
QString systemRoot;
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->buildConfiguration->target()->profile()))
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->buildConfiguration->target()->profile()).toString();
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->profile))
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->profile).toString();
const QDateTime &lastDeployed = d->lastDeployed.value(DeployParameters(deployableFile,
deviceConfiguration()->sshParameters().host, systemRoot));
return !lastDeployed.isValid()
......@@ -165,6 +171,10 @@ void AbstractRemoteLinuxDeployService::setDeviceConfiguration(const LinuxDeviceC
void AbstractRemoteLinuxDeployService::setBuildConfiguration(Qt4BuildConfiguration *bc)
{
d->buildConfiguration = bc;
if (bc && bc->target())
d->profile = bc->target()->profile();
else
d->profile = 0;
}
void AbstractRemoteLinuxDeployService::start()
......
......@@ -35,13 +35,10 @@
#include <QObject>
#include <QSharedPointer>
#include <QVariantMap>
QT_FORWARD_DECLARE_CLASS(QString)
namespace QSsh { class SshConnection; }
namespace Qt4ProjectManager {
class Qt4BuildConfiguration;
}
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace ProjectExplorer { class Profile; }
namespace RemoteLinux {
class DeployableFile;
......@@ -79,6 +76,7 @@ signals:
protected:
const Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfiguration() const;
const ProjectExplorer::Profile *profile() const;
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
QSsh::SshConnection *connection() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment