diff options
author | hjk <qthjk@ovi.com> | 2012-07-25 17:36:35 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@nokia.com> | 2012-07-26 10:35:02 +0200 |
commit | 0fcd30cc6191925ea3cba2baad6533a946c9ccd2 (patch) | |
tree | 19794335c39ed8d4a698deb1b40506aea5dbc529 | |
parent | 1bbcfd17a9a78107e5f09d1287ae19459f31ab8f (diff) | |
download | qt-creator-0fcd30cc6191925ea3cba2baad6533a946c9ccd2.tar.gz |
madde: prefer using Profile instead of qt4BuildConfiguration etc
Change-Id: I6fe64f7a4a5713c09ea02460a958758d0938fc19
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
-rw-r--r-- | src/plugins/madde/maemodeploybymountsteps.cpp | 3 | ||||
-rw-r--r-- | src/plugins/madde/maemodeploymentmounter.cpp | 11 | ||||
-rw-r--r-- | src/plugins/madde/maemodeploymentmounter.h | 6 | ||||
-rw-r--r-- | src/plugins/madde/maemoremotemounter.cpp | 10 | ||||
-rw-r--r-- | src/plugins/madde/maemoremotemounter.h | 6 | ||||
-rw-r--r-- | src/plugins/madde/maemosshrunner.cpp | 8 | ||||
-rw-r--r-- | src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp | 24 | ||||
-rw-r--r-- | src/plugins/remotelinux/abstractremotelinuxdeployservice.h | 8 |
8 files changed, 40 insertions, 36 deletions
diff --git a/src/plugins/madde/maemodeploybymountsteps.cpp b/src/plugins/madde/maemodeploybymountsteps.cpp index 132b5be02f..116a949ac0 100644 --- a/src/plugins/madde/maemodeploybymountsteps.cpp +++ b/src/plugins/madde/maemodeploybymountsteps.cpp @@ -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() diff --git a/src/plugins/madde/maemodeploymentmounter.cpp b/src/plugins/madde/maemodeploymentmounter.cpp index f85bb7d576..5830284e1e 100644 --- a/src/plugins/madde/maemodeploymentmounter.cpp +++ b/src/plugins/madde/maemodeploymentmounter.cpp @@ -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); } diff --git a/src/plugins/madde/maemodeploymentmounter.h b/src/plugins/madde/maemodeploymentmounter.h index 974abb64fd..469fc9dfb7 100644 --- a/src/plugins/madde/maemodeploymentmounter.h +++ b/src/plugins/madde/maemodeploymentmounter.h @@ -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 diff --git a/src/plugins/madde/maemoremotemounter.cpp b/src/plugins/madde/maemoremotemounter.cpp index 695a27e98f..8ed3ac55f5 100644 --- a/src/plugins/madde/maemoremotemounter.cpp +++ b/src/plugins/madde/maemoremotemounter.cpp @@ -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, diff --git a/src/plugins/madde/maemoremotemounter.h b/src/plugins/madde/maemoremotemounter.h index 42423afcef..6ade8dbe34 100644 --- a/src/plugins/madde/maemoremotemounter.h +++ b/src/plugins/madde/maemoremotemounter.h @@ -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; diff --git a/src/plugins/madde/maemosshrunner.cpp b/src/plugins/madde/maemosshrunner.cpp index e6c0acf435..d177d60170 100644 --- a/src/plugins/madde/maemosshrunner.cpp +++ b/src/plugins/madde/maemosshrunner.cpp @@ -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, diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp index 2b6f2c8b6c..ccc988dbd6 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp @@ -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() diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.h b/src/plugins/remotelinux/abstractremotelinuxdeployservice.h index cba3a87f5e..b54a34b2e6 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.h @@ -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; |