diff --git a/src/plugins/remotelinux/maemodeployablelistmodel.cpp b/src/plugins/remotelinux/maemodeployablelistmodel.cpp index b92e128887c..01e0de3af94 100644 --- a/src/plugins/remotelinux/maemodeployablelistmodel.cpp +++ b/src/plugins/remotelinux/maemodeployablelistmodel.cpp @@ -57,9 +57,10 @@ using namespace Qt4ProjectManager; namespace RemoteLinux { namespace Internal { -MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode, - ProFileUpdateSetting updateSetting, QObject *parent) +MaemoDeployableListModel::MaemoDeployableListModel(const Qt4BaseTarget *target, + const Qt4ProFileNode *proFileNode, ProFileUpdateSetting updateSetting, QObject *parent) : QAbstractTableModel(parent), + m_target(target), m_projectType(proFileNode->projectType()), m_proFilePath(proFileNode->path()), m_projectName(proFileNode->displayName()), @@ -330,14 +331,7 @@ bool MaemoDeployableListModel::addLinesToProFile(const QStringList &lines) const QtSupport::BaseQtVersion *MaemoDeployableListModel::qtVersion() const { - const ProjectExplorer::Project *const activeProject - = ProjectExplorer::ProjectExplorerPlugin::instance()->session()->startupProject(); - QTC_ASSERT(activeProject, return 0); - const Qt4BaseTarget *const activeTarget - = qobject_cast(activeProject->activeTarget()); - QTC_ASSERT(activeTarget, return 0); - const Qt4BuildConfiguration *const bc - = activeTarget->activeBuildConfiguration(); + const Qt4BuildConfiguration *const bc = m_target->activeBuildConfiguration(); QTC_ASSERT(bc, return 0); return bc->qtVersion(); } diff --git a/src/plugins/remotelinux/maemodeployablelistmodel.h b/src/plugins/remotelinux/maemodeployablelistmodel.h index c302d8eac67..a53d4a2bd49 100644 --- a/src/plugins/remotelinux/maemodeployablelistmodel.h +++ b/src/plugins/remotelinux/maemodeployablelistmodel.h @@ -46,6 +46,9 @@ namespace QtSupport { class BaseQtVersion; } +namespace Qt4ProjectManager { +class Qt4BaseTarget; +} namespace RemoteLinux { namespace Internal { @@ -58,8 +61,9 @@ public: UpdateProFile, DontUpdateProFile, AskToUpdateProFile }; - MaemoDeployableListModel(const Qt4ProjectManager::Qt4ProFileNode *proFileNode, - ProFileUpdateSetting updateSetting, QObject *parent); + MaemoDeployableListModel(const Qt4ProjectManager::Qt4BaseTarget *target, + const Qt4ProjectManager::Qt4ProFileNode *proFileNode, ProFileUpdateSetting updateSetting, + QObject *parent); ~MaemoDeployableListModel(); virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; @@ -107,6 +111,7 @@ private: QString remoteIconDir() const; QStringList localLibraryFilePaths() const; + const Qt4ProjectManager::Qt4BaseTarget * const m_target; const Qt4ProjectManager::Qt4ProjectType m_projectType; const QString m_proFilePath; const QString m_projectName; diff --git a/src/plugins/remotelinux/maemodeployables.cpp b/src/plugins/remotelinux/maemodeployables.cpp index 83be56a5822..9ff3edca33e 100644 --- a/src/plugins/remotelinux/maemodeployables.cpp +++ b/src/plugins/remotelinux/maemodeployables.cpp @@ -129,7 +129,7 @@ void MaemoDeployables::createModels(const Qt4ProFileNode *proFileNode) ? it.value() : MaemoDeployableListModel::AskToUpdateProFile; } MaemoDeployableListModel *const newModel - = new MaemoDeployableListModel(proFileNode, updateSetting, this); + = new MaemoDeployableListModel(m_target, proFileNode, updateSetting, this); m_listModels << newModel; break; }