forked from qt-creator/qt-creator
Project: Improve default implementation of Project::needsConfiguration
Change-Id: Ic4d227334d818658f179c0589462551509274c17 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -361,11 +361,6 @@ CMakeProjectNode *CMakeProject::generateProjectTree(const QList<const FileNode *
|
|||||||
return root ? root.release() : nullptr;
|
return root ? root.release() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMakeProject::needsConfiguration() const
|
|
||||||
{
|
|
||||||
return targets().isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CMakeProject::knowsAllBuildExecutables() const
|
bool CMakeProject::knowsAllBuildExecutables() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@@ -68,7 +68,6 @@ public:
|
|||||||
|
|
||||||
CMakeBuildTarget buildTargetForTitle(const QString &title);
|
CMakeBuildTarget buildTargetForTitle(const QString &title);
|
||||||
|
|
||||||
bool needsConfiguration() const final;
|
|
||||||
bool knowsAllBuildExecutables() const final;
|
bool knowsAllBuildExecutables() const final;
|
||||||
|
|
||||||
bool supportsKit(const ProjectExplorer::Kit *k, QString *errorMessage = nullptr) const final;
|
bool supportsKit(const ProjectExplorer::Kit *k, QString *errorMessage = nullptr) const final;
|
||||||
|
@@ -42,6 +42,8 @@ class CPPTOOLS_EXPORT TestProject: public ProjectExplorer::Project
|
|||||||
public:
|
public:
|
||||||
TestProject(const QString &name, QObject *parent);
|
TestProject(const QString &name, QObject *parent);
|
||||||
|
|
||||||
|
bool needsConfiguration() const final { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_name;
|
QString m_name;
|
||||||
};
|
};
|
||||||
|
@@ -72,11 +72,6 @@ NimProject::NimProject(const FileName &fileName) : Project(Constants::C_NIM_MIME
|
|||||||
collectProjectFiles();
|
collectProjectFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NimProject::needsConfiguration() const
|
|
||||||
{
|
|
||||||
return targets().empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void NimProject::scheduleProjectScan()
|
void NimProject::scheduleProjectScan()
|
||||||
{
|
{
|
||||||
auto elapsedTime = m_lastProjectScan.elapsed();
|
auto elapsedTime = m_lastProjectScan.elapsed();
|
||||||
|
@@ -41,7 +41,6 @@ class NimProject : public ProjectExplorer::Project
|
|||||||
public:
|
public:
|
||||||
explicit NimProject(const Utils::FileName &fileName);
|
explicit NimProject(const Utils::FileName &fileName);
|
||||||
|
|
||||||
bool needsConfiguration() const final;
|
|
||||||
bool supportsKit(const ProjectExplorer::Kit *k, QString *errorMessage) const final;
|
bool supportsKit(const ProjectExplorer::Kit *k, QString *errorMessage) const final;
|
||||||
Utils::FileNameList nimFiles() const;
|
Utils::FileNameList nimFiles() const;
|
||||||
QVariantMap toMap() const final;
|
QVariantMap toMap() const final;
|
||||||
|
@@ -813,7 +813,7 @@ void Project::setNamedSettings(const QString &name, const QVariant &value)
|
|||||||
|
|
||||||
bool Project::needsConfiguration() const
|
bool Project::needsConfiguration() const
|
||||||
{
|
{
|
||||||
return false;
|
return d->m_targets.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
void Project::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
||||||
@@ -933,6 +933,8 @@ public:
|
|||||||
void testParsingFinished(bool success) {
|
void testParsingFinished(bool success) {
|
||||||
emitParsingFinished(success);
|
emitParsingFinished(success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool needsConfiguration() const final { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestProjectNode : public ProjectNode
|
class TestProjectNode : public ProjectNode
|
||||||
|
@@ -2219,6 +2219,8 @@ public:
|
|||||||
TestProject() : Project("x-test/testproject", Utils::FileName::fromString("/test/project")) {
|
TestProject() : Project("x-test/testproject", Utils::FileName::fromString("/test/project")) {
|
||||||
setDisplayName("Test Project");
|
setDisplayName("Test Project");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool needsConfiguration() const final { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -91,6 +91,8 @@ public:
|
|||||||
bool renameFile(const QString &filePath, const QString &newFilePath);
|
bool renameFile(const QString &filePath, const QString &newFilePath);
|
||||||
void refresh(Target *target = nullptr);
|
void refresh(Target *target = nullptr);
|
||||||
|
|
||||||
|
bool needsConfiguration() const final { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
||||||
bool setupTarget(Target *t)
|
bool setupTarget(Target *t)
|
||||||
|
@@ -134,7 +134,6 @@ private:
|
|||||||
|
|
||||||
void projectLoaded() override;
|
void projectLoaded() override;
|
||||||
ProjectExplorer::ProjectImporter *projectImporter() const override;
|
ProjectExplorer::ProjectImporter *projectImporter() const override;
|
||||||
bool needsConfiguration() const override { return targets().isEmpty(); }
|
|
||||||
|
|
||||||
static bool ensureWriteableQbsFile(const QString &file);
|
static bool ensureWriteableQbsFile(const QString &file);
|
||||||
|
|
||||||
|
@@ -1025,11 +1025,6 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
|
|||||||
m_project->updateCodeModels();
|
m_project->updateCodeModels();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmakeProject::needsConfiguration() const
|
|
||||||
{
|
|
||||||
return targets().isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmakeProject::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
void QmakeProject::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
||||||
{
|
{
|
||||||
QList<const BuildInfo *> infoList;
|
QList<const BuildInfo *> infoList;
|
||||||
|
@@ -105,8 +105,6 @@ 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);
|
||||||
|
|
||||||
bool needsConfiguration() const final;
|
|
||||||
|
|
||||||
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
|
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
|
||||||
|
|
||||||
/// \internal
|
/// \internal
|
||||||
|
@@ -64,6 +64,8 @@ public:
|
|||||||
root->addNode(fileNode);
|
root->addNode(fileNode);
|
||||||
setRootProjectNode(root);
|
setRootProjectNode(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool needsConfiguration() const final { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlProfilerDetailsRewriterTest::QmlProfilerDetailsRewriterTest(QObject *parent) : QObject(parent)
|
QmlProfilerDetailsRewriterTest::QmlProfilerDetailsRewriterTest(QObject *parent) : QObject(parent)
|
||||||
|
Reference in New Issue
Block a user