forked from qt-creator/qt-creator
ProjectExplorer: Reduce ProjectExplorer::configureAsExampleProject()
... to the bits that are actually used. Change-Id: I39a6ed1f4136d75b776bb89eec6165479097a4ec Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -234,7 +234,7 @@ bool OpenProjectCommand::run()
|
|||||||
QTC_ASSERT(openProjectSucceeded, return false);
|
QTC_ASSERT(openProjectSucceeded, return false);
|
||||||
|
|
||||||
Project *project = openProjectSucceeded.project();
|
Project *project = openProjectSucceeded.project();
|
||||||
project->configureAsExampleProject({});
|
project->configureAsExampleProject();
|
||||||
|
|
||||||
return CppTools::Tests::TestCase::waitUntilCppModelManagerIsAwareOf(project, timeOutInMs());
|
return CppTools::Tests::TestCase::waitUntilCppModelManagerIsAwareOf(project, timeOutInMs());
|
||||||
}
|
}
|
||||||
|
@@ -291,7 +291,7 @@ ProjectInfo ProjectOpenerAndCloser::open(const QString &projectFile, bool config
|
|||||||
|
|
||||||
Project *project = result.project();
|
Project *project = result.project();
|
||||||
if (configureAsExampleProject)
|
if (configureAsExampleProject)
|
||||||
project->configureAsExampleProject({ });
|
project->configureAsExampleProject();
|
||||||
|
|
||||||
if (TestCase::waitUntilCppModelManagerIsAwareOf(project)) {
|
if (TestCase::waitUntilCppModelManagerIsAwareOf(project)) {
|
||||||
m_openProjects.append(project);
|
m_openProjects.append(project);
|
||||||
|
@@ -844,9 +844,8 @@ bool Project::needsBuildConfigurations() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
void Project::configureAsExampleProject()
|
||||||
{
|
{
|
||||||
Q_UNUSED(platforms);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Project::knowsAllBuildExecutables() const
|
bool Project::knowsAllBuildExecutables() const
|
||||||
|
@@ -156,7 +156,7 @@ public:
|
|||||||
|
|
||||||
virtual bool needsConfiguration() const;
|
virtual bool needsConfiguration() const;
|
||||||
virtual bool needsBuildConfigurations() const;
|
virtual bool needsBuildConfigurations() const;
|
||||||
virtual void configureAsExampleProject(const QSet<Core::Id> &platforms);
|
virtual void configureAsExampleProject();
|
||||||
|
|
||||||
virtual ProjectImporter *projectImporter() const;
|
virtual ProjectImporter *projectImporter() const;
|
||||||
|
|
||||||
|
@@ -713,20 +713,15 @@ QString QbsProject::uniqueProductName(const qbs::ProductData &product)
|
|||||||
return product.name() + QLatin1Char('.') + product.multiplexConfigurationId();
|
return product.name() + QLatin1Char('.') + product.multiplexConfigurationId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProject::configureAsExampleProject(const QSet<Id> &platforms)
|
void QbsProject::configureAsExampleProject()
|
||||||
{
|
{
|
||||||
QList<BuildInfo> infoList;
|
QList<BuildInfo> infoList;
|
||||||
QList<Kit *> kits = KitManager::kits();
|
const QList<Kit *> kits = KitManager::kits();
|
||||||
const auto qtVersionMatchesPlatform = [platforms](const QtSupport::BaseQtVersion *version) {
|
for (Kit *k : kits) {
|
||||||
return platforms.isEmpty() || platforms.intersects(version->targetDeviceTypes());
|
if (QtSupport::QtKitAspect::qtVersion(k) != nullptr) {
|
||||||
};
|
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
||||||
foreach (Kit *k, kits) {
|
infoList << factory->allAvailableSetups(k, projectFilePath());
|
||||||
const QtSupport::BaseQtVersion * const qtVersion
|
}
|
||||||
= QtSupport::QtKitAspect::qtVersion(k);
|
|
||||||
if (!qtVersion || !qtVersionMatchesPlatform(qtVersion))
|
|
||||||
continue;
|
|
||||||
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
|
||||||
infoList << factory->allAvailableSetups(k, projectFilePath());
|
|
||||||
}
|
}
|
||||||
setup(infoList);
|
setup(infoList);
|
||||||
prepareForParsing();
|
prepareForParsing();
|
||||||
|
@@ -98,7 +98,7 @@ public:
|
|||||||
|
|
||||||
static QString uniqueProductName(const qbs::ProductData &product);
|
static QString uniqueProductName(const qbs::ProductData &product);
|
||||||
|
|
||||||
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
|
void configureAsExampleProject() final;
|
||||||
|
|
||||||
void delayParsing();
|
void delayParsing();
|
||||||
|
|
||||||
|
@@ -938,19 +938,15 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
|
|||||||
m_project->updateCodeModels();
|
m_project->updateCodeModels();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmakeProject::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
void QmakeProject::configureAsExampleProject()
|
||||||
{
|
{
|
||||||
QList<BuildInfo> infoList;
|
QList<BuildInfo> infoList;
|
||||||
QList<Kit *> kits = KitManager::kits();
|
const QList<Kit *> kits = KitManager::kits();
|
||||||
foreach (Kit *k, kits) {
|
for (Kit *k : kits) {
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
|
if (QtSupport::QtKitAspect::qtVersion(k) != nullptr) {
|
||||||
if (!version
|
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
||||||
|| (!platforms.isEmpty()
|
infoList << factory->allAvailableSetups(k, projectFilePath());
|
||||||
&& !Utils::contains(version->targetDeviceTypes(), [platforms](Core::Id i) { return platforms.contains(i); })))
|
}
|
||||||
continue;
|
|
||||||
|
|
||||||
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
|
||||||
infoList << factory->allAvailableSetups(k, projectFilePath());
|
|
||||||
}
|
}
|
||||||
setup(infoList);
|
setup(infoList);
|
||||||
}
|
}
|
||||||
|
@@ -95,7 +95,7 @@ public:
|
|||||||
void watchFolders(const QStringList &l, QmakePriFile *file);
|
void watchFolders(const QStringList &l, QmakePriFile *file);
|
||||||
void unwatchFolders(const QStringList &l, QmakePriFile *file);
|
void unwatchFolders(const QStringList &l, QmakePriFile *file);
|
||||||
|
|
||||||
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
|
void configureAsExampleProject() final;
|
||||||
|
|
||||||
void emitBuildDirectoryInitialized();
|
void emitBuildDirectoryInitialized();
|
||||||
static void proFileParseError(const QString &errorMessage);
|
static void proFileParseError(const QString &errorMessage);
|
||||||
|
Reference in New Issue
Block a user