Project: Improve default implementation of Project::needsConfiguration

Change-Id: Ic4d227334d818658f179c0589462551509274c17
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2018-03-09 13:30:13 +01:00
parent 964476983e
commit 835d4e92f3
12 changed files with 11 additions and 21 deletions

View File

@@ -361,11 +361,6 @@ CMakeProjectNode *CMakeProject::generateProjectTree(const QList<const FileNode *
return root ? root.release() : nullptr;
}
bool CMakeProject::needsConfiguration() const
{
return targets().isEmpty();
}
bool CMakeProject::knowsAllBuildExecutables() const
{
return false;

View File

@@ -68,7 +68,6 @@ public:
CMakeBuildTarget buildTargetForTitle(const QString &title);
bool needsConfiguration() const final;
bool knowsAllBuildExecutables() const final;
bool supportsKit(const ProjectExplorer::Kit *k, QString *errorMessage = nullptr) const final;

View File

@@ -42,6 +42,8 @@ class CPPTOOLS_EXPORT TestProject: public ProjectExplorer::Project
public:
TestProject(const QString &name, QObject *parent);
bool needsConfiguration() const final { return false; }
private:
QString m_name;
};

View File

@@ -72,11 +72,6 @@ NimProject::NimProject(const FileName &fileName) : Project(Constants::C_NIM_MIME
collectProjectFiles();
}
bool NimProject::needsConfiguration() const
{
return targets().empty();
}
void NimProject::scheduleProjectScan()
{
auto elapsedTime = m_lastProjectScan.elapsed();

View File

@@ -41,7 +41,6 @@ class NimProject : public ProjectExplorer::Project
public:
explicit NimProject(const Utils::FileName &fileName);
bool needsConfiguration() const final;
bool supportsKit(const ProjectExplorer::Kit *k, QString *errorMessage) const final;
Utils::FileNameList nimFiles() const;
QVariantMap toMap() const final;

View File

@@ -813,7 +813,7 @@ void Project::setNamedSettings(const QString &name, const QVariant &value)
bool Project::needsConfiguration() const
{
return false;
return d->m_targets.isEmpty();
}
void Project::configureAsExampleProject(const QSet<Core::Id> &platforms)
@@ -933,6 +933,8 @@ public:
void testParsingFinished(bool success) {
emitParsingFinished(success);
}
bool needsConfiguration() const final { return false; }
};
class TestProjectNode : public ProjectNode

View File

@@ -2219,6 +2219,8 @@ public:
TestProject() : Project("x-test/testproject", Utils::FileName::fromString("/test/project")) {
setDisplayName("Test Project");
}
bool needsConfiguration() const final { return false; }
};
} // namespace

View File

@@ -91,6 +91,8 @@ public:
bool renameFile(const QString &filePath, const QString &newFilePath);
void refresh(Target *target = nullptr);
bool needsConfiguration() const final { return false; }
private:
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
bool setupTarget(Target *t)

View File

@@ -134,7 +134,6 @@ private:
void projectLoaded() override;
ProjectExplorer::ProjectImporter *projectImporter() const override;
bool needsConfiguration() const override { return targets().isEmpty(); }
static bool ensureWriteableQbsFile(const QString &file);

View File

@@ -1025,11 +1025,6 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
m_project->updateCodeModels();
}
bool QmakeProject::needsConfiguration() const
{
return targets().isEmpty();
}
void QmakeProject::configureAsExampleProject(const QSet<Core::Id> &platforms)
{
QList<const BuildInfo *> infoList;

View File

@@ -105,8 +105,6 @@ public:
void watchFolders(const QStringList &l, QmakePriFile *file);
void unwatchFolders(const QStringList &l, QmakePriFile *file);
bool needsConfiguration() const final;
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
/// \internal

View File

@@ -64,6 +64,8 @@ public:
root->addNode(fileNode);
setRootProjectNode(root);
}
bool needsConfiguration() const final { return false; }
};
QmlProfilerDetailsRewriterTest::QmlProfilerDetailsRewriterTest(QObject *parent) : QObject(parent)