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);
|
||||
|
||||
Project *project = openProjectSucceeded.project();
|
||||
project->configureAsExampleProject({});
|
||||
project->configureAsExampleProject();
|
||||
|
||||
return CppTools::Tests::TestCase::waitUntilCppModelManagerIsAwareOf(project, timeOutInMs());
|
||||
}
|
||||
|
@@ -291,7 +291,7 @@ ProjectInfo ProjectOpenerAndCloser::open(const QString &projectFile, bool config
|
||||
|
||||
Project *project = result.project();
|
||||
if (configureAsExampleProject)
|
||||
project->configureAsExampleProject({ });
|
||||
project->configureAsExampleProject();
|
||||
|
||||
if (TestCase::waitUntilCppModelManagerIsAwareOf(project)) {
|
||||
m_openProjects.append(project);
|
||||
|
@@ -844,9 +844,8 @@ bool Project::needsBuildConfigurations() const
|
||||
return true;
|
||||
}
|
||||
|
||||
void Project::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
||||
void Project::configureAsExampleProject()
|
||||
{
|
||||
Q_UNUSED(platforms);
|
||||
}
|
||||
|
||||
bool Project::knowsAllBuildExecutables() const
|
||||
|
@@ -156,7 +156,7 @@ public:
|
||||
|
||||
virtual bool needsConfiguration() const;
|
||||
virtual bool needsBuildConfigurations() const;
|
||||
virtual void configureAsExampleProject(const QSet<Core::Id> &platforms);
|
||||
virtual void configureAsExampleProject();
|
||||
|
||||
virtual ProjectImporter *projectImporter() const;
|
||||
|
||||
|
@@ -713,21 +713,16 @@ QString QbsProject::uniqueProductName(const qbs::ProductData &product)
|
||||
return product.name() + QLatin1Char('.') + product.multiplexConfigurationId();
|
||||
}
|
||||
|
||||
void QbsProject::configureAsExampleProject(const QSet<Id> &platforms)
|
||||
void QbsProject::configureAsExampleProject()
|
||||
{
|
||||
QList<BuildInfo> infoList;
|
||||
QList<Kit *> kits = KitManager::kits();
|
||||
const auto qtVersionMatchesPlatform = [platforms](const QtSupport::BaseQtVersion *version) {
|
||||
return platforms.isEmpty() || platforms.intersects(version->targetDeviceTypes());
|
||||
};
|
||||
foreach (Kit *k, kits) {
|
||||
const QtSupport::BaseQtVersion * const qtVersion
|
||||
= QtSupport::QtKitAspect::qtVersion(k);
|
||||
if (!qtVersion || !qtVersionMatchesPlatform(qtVersion))
|
||||
continue;
|
||||
const QList<Kit *> kits = KitManager::kits();
|
||||
for (Kit *k : kits) {
|
||||
if (QtSupport::QtKitAspect::qtVersion(k) != nullptr) {
|
||||
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
||||
infoList << factory->allAvailableSetups(k, projectFilePath());
|
||||
}
|
||||
}
|
||||
setup(infoList);
|
||||
prepareForParsing();
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ public:
|
||||
|
||||
static QString uniqueProductName(const qbs::ProductData &product);
|
||||
|
||||
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
|
||||
void configureAsExampleProject() final;
|
||||
|
||||
void delayParsing();
|
||||
|
||||
|
@@ -938,20 +938,16 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
|
||||
m_project->updateCodeModels();
|
||||
}
|
||||
|
||||
void QmakeProject::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
||||
void QmakeProject::configureAsExampleProject()
|
||||
{
|
||||
QList<BuildInfo> infoList;
|
||||
QList<Kit *> kits = KitManager::kits();
|
||||
foreach (Kit *k, kits) {
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
|
||||
if (!version
|
||||
|| (!platforms.isEmpty()
|
||||
&& !Utils::contains(version->targetDeviceTypes(), [platforms](Core::Id i) { return platforms.contains(i); })))
|
||||
continue;
|
||||
|
||||
const QList<Kit *> kits = KitManager::kits();
|
||||
for (Kit *k : kits) {
|
||||
if (QtSupport::QtKitAspect::qtVersion(k) != nullptr) {
|
||||
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
||||
infoList << factory->allAvailableSetups(k, projectFilePath());
|
||||
}
|
||||
}
|
||||
setup(infoList);
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,7 @@ public:
|
||||
void watchFolders(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();
|
||||
static void proFileParseError(const QString &errorMessage);
|
||||
|
Reference in New Issue
Block a user