GenericProject: Use own target instead of activeTarget()

... when updating deployment data.

Change-Id: Ifa18d4f4fce2fddba91989e2c3094299d4d1f0ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-02-05 12:32:44 +01:00
parent ea6da69e8b
commit 4ad4871fdc

View File

@@ -576,23 +576,20 @@ void GenericBuildSystem::updateDeploymentData()
{
static const QString fileName("QtCreatorDeployment.txt");
Utils::FilePath deploymentFilePath;
Target *target = project()->activeTarget();
if (target && target->activeBuildConfiguration()) {
deploymentFilePath = target->activeBuildConfiguration()->buildDirectory()
.pathAppended(fileName);
}
BuildConfiguration *bc = target()->activeBuildConfiguration();
if (bc)
deploymentFilePath = bc->buildDirectory().pathAppended(fileName);
bool hasDeploymentData = QFileInfo::exists(deploymentFilePath.toString());
if (!hasDeploymentData) {
deploymentFilePath = projectDirectory().pathAppended(fileName);
hasDeploymentData = QFileInfo::exists(deploymentFilePath.toString());
}
if (hasDeploymentData) {
if (target) {
DeploymentData deploymentData;
deploymentData.addFilesFromDeploymentFile(deploymentFilePath.toString(),
projectDirectory().toString());
setDeploymentData(deploymentData);
}
if (m_deployFileWatcher.files() != QStringList(deploymentFilePath.toString())) {
m_deployFileWatcher.removeFiles(m_deployFileWatcher.files());
m_deployFileWatcher.addFile(deploymentFilePath.toString(),