forked from qt-creator/qt-creator
ProjectExplorer: Expose less direct use of activeTarget etc
The decision should be made closer to the UI triggering it. Change-Id: Iaed8154dd7daffaae128ec825c6ed1ae7c4c32f5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1084,15 +1084,6 @@ void Project::configureAsExampleProject(Kit * /*kit*/)
|
||||
{
|
||||
}
|
||||
|
||||
void Project::buildTarget(const QString &target)
|
||||
{
|
||||
if (!activeTarget() || !activeTarget()->activeBuildConfiguration()
|
||||
|| !activeTarget()->activeBuildConfiguration()->buildSystem()) {
|
||||
return;
|
||||
}
|
||||
activeTarget()->activeBuildConfiguration()->buildSystem()->buildNamedTarget(target);
|
||||
}
|
||||
|
||||
bool Project::hasMakeInstallEquivalent() const
|
||||
{
|
||||
return d->m_hasMakeInstallEquivalent;
|
||||
|
@@ -131,8 +131,6 @@ public:
|
||||
bool needsBuildConfigurations() const;
|
||||
virtual void configureAsExampleProject(ProjectExplorer::Kit *kit);
|
||||
|
||||
void buildTarget(const QString &target);
|
||||
|
||||
virtual ProjectImporter *projectImporter() const;
|
||||
|
||||
virtual DeploymentKnowledge deploymentKnowledge() const { return DeploymentKnowledge::Bad; }
|
||||
|
@@ -113,30 +113,20 @@ void QmlTaskManager::updateMessages()
|
||||
m_updateDelay.start();
|
||||
}
|
||||
|
||||
static void triggerQmllintCMakeTarget()
|
||||
{
|
||||
if (ProjectManager::startupProject())
|
||||
ProjectManager::startupProject()->buildTarget(Constants::QMLLINT_BUILD_TARGET);
|
||||
}
|
||||
|
||||
void QmlTaskManager::updateSemanticMessagesNow()
|
||||
{
|
||||
// note: this can only be called for the startup project
|
||||
Project *project = ProjectManager::startupProject();
|
||||
if (!project)
|
||||
return;
|
||||
|
||||
BuildSystem *buildSystem = ProjectManager::startupBuildSystem();
|
||||
if (!buildSystem)
|
||||
return;
|
||||
|
||||
const bool isCMake = buildSystem->name() == "cmake";
|
||||
// heuristic: qmllint will output meaningful warnings if qmlls is enabled
|
||||
if (isCMake && QmllsSettingsManager::instance()->useQmlls(project)) {
|
||||
if (isCMake && QmllsSettingsManager::instance()->useQmlls(buildSystem->project())) {
|
||||
// abort any update that's going on already, and remove old codemodel warnings
|
||||
m_messageCollector.cancel();
|
||||
removeAllTasks(true);
|
||||
triggerQmllintCMakeTarget();
|
||||
buildSystem->buildTarget(Constants::QMLLINT_BUILD_TARGET);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user