forked from qt-creator/qt-creator
improve code
Change-Id: I06c7274c39f7e369d4cd9bed0c1ef77e4bc08b35 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -288,8 +288,8 @@ QJsonObject AndroidManager::deploymentSettings(const Target *target)
|
||||
|
||||
Utils::FilePath AndroidManager::dirPath(const ProjectExplorer::Target *target)
|
||||
{
|
||||
if (target->activeBuildConfiguration())
|
||||
return target->activeBuildConfiguration()->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY);
|
||||
if (auto *bc = target->activeBuildConfiguration())
|
||||
return bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY);
|
||||
return Utils::FilePath();
|
||||
}
|
||||
|
||||
|
@@ -315,15 +315,11 @@ static ::Utils::FilePath compilerPath(const CppTools::ProjectPart &projectPart)
|
||||
|
||||
static ::Utils::FilePath buildDirectory(const ProjectExplorer::Project &project)
|
||||
{
|
||||
ProjectExplorer::Target *target = project.activeTarget();
|
||||
if (!target)
|
||||
return ::Utils::FilePath();
|
||||
|
||||
ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration();
|
||||
if (!buildConfig)
|
||||
return ::Utils::FilePath();
|
||||
|
||||
return buildConfig->buildDirectory();
|
||||
if (auto *target = project.activeTarget()) {
|
||||
if (auto *bc = target->activeBuildConfiguration())
|
||||
return bc->buildDirectory();
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
static QStringList projectPartArguments(const ProjectPart &projectPart)
|
||||
|
@@ -495,7 +495,7 @@ void ClangToolRunWorker::finalize()
|
||||
QString msg = tr("%1: Not all files could be analyzed.").arg(toolName);
|
||||
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
|
||||
Target *target = runControl()->target();
|
||||
if (target && !target->activeBuildConfiguration()->buildDirectory().exists()
|
||||
if (target && target->activeBuildConfiguration() && !target->activeBuildConfiguration()->buildDirectory().exists()
|
||||
&& !m_runSettings.buildBeforeAnalysis()) {
|
||||
msg = tr("%1: You might need to build the project to generate or update source "
|
||||
"files. To build automatically, enable \"Build the project before starting "
|
||||
|
@@ -106,11 +106,8 @@ void PerfLoadDialog::chooseDefaults()
|
||||
|
||||
ui->kitChooser->setCurrentKitId(target->kit()->id());
|
||||
|
||||
ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration();
|
||||
if (!buildConfig)
|
||||
return;
|
||||
|
||||
ui->executableDirLineEdit->setText(buildConfig->buildDirectory().toString());
|
||||
if (auto *bc = target->activeBuildConfiguration())
|
||||
ui->executableDirLineEdit->setText(bc->buildDirectory().toString());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user