forked from qt-creator/qt-creator
RemoteLinux: Fix possible race condition.
When opening a new project, the deployables code can apparently be run before an active project is set. Task-number: https://projects.maemo.org/bugzilla/show_bug.cgi?id=251230 Change-Id: Ia8e3067823ee45553364b0e7a867563d008332cd Reviewed-on: http://codereview.qt.nokia.com/243 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -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<Qt4BaseTarget *>(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();
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user