Commit a3f827b1 authored by dt's avatar dt
Browse files

Remove isApplication() and simplfy startup project logic

parent 4dc3ead0
......@@ -436,11 +436,6 @@ QList<ProjectExplorer::Project *> CMakeProject::dependsOn()
return QList<Project *>();
}
bool CMakeProject::isApplication() const
{
return true;
}
ProjectExplorer::BuildConfigWidget *CMakeProject::createConfigWidget()
{
return new CMakeBuildSettingsWidget(this);
......
......@@ -83,8 +83,6 @@ public:
QList<ProjectExplorer::Project *> dependsOn(); //NBS TODO implement dependsOn
bool isApplication() const;
ProjectExplorer::BuildConfigWidget *createConfigWidget();
QList<ProjectExplorer::BuildConfigWidget*> subConfigWidgets();
......
......@@ -388,11 +388,6 @@ QList<ProjectExplorer::Project *> GenericProject::dependsOn()
return QList<Project *>();
}
bool GenericProject::isApplication() const
{
return true;
}
ProjectExplorer::BuildConfigWidget *GenericProject::createConfigWidget()
{
return new GenericBuildSettingsWidget(this);
......
......@@ -78,8 +78,6 @@ public:
QList<ProjectExplorer::Project *> dependsOn();
bool isApplication() const;
ProjectExplorer::BuildConfigWidget *createConfigWidget();
QList<ProjectExplorer::BuildConfigWidget*> subConfigWidgets();
......
......@@ -72,7 +72,6 @@ public:
virtual QList<Project *> dependsOn() = 0; //NBS TODO implement dependsOn
virtual bool isApplication() const = 0;
bool hasActiveBuildSettings() const;
// EditorConfiguration:
......
......@@ -598,8 +598,8 @@ void SessionManager::addProjects(const QList<Project*> &projects)
// maybe we have a new startup project?
if (!startupProject())
if (Project *newStartupProject = defaultStartupProject())
setStartupProject(newStartupProject);
if (!m_file->m_projects.isEmpty())
setStartupProject(m_file->m_projects.first());
}
void SessionManager::removeProject(Project *project)
......@@ -631,7 +631,7 @@ bool SessionManager::createImpl(const QString &fileName)
delete m_file;
m_file = new SessionFile;
m_file->setFileName(fileName);
setStartupProject(defaultStartupProject());
setStartupProject(0);
}
m_defaultVirginSession = false;
......@@ -792,16 +792,6 @@ QStringList SessionManager::dependenciesOrder() const
return ordered;
}
Project *SessionManager::defaultStartupProject() const
{
// Just take first one
foreach (Project *p, m_file->m_projects) {
if (p->isApplication())
return p;
}
return 0;
}
QList<Project *> SessionManager::projectOrder(Project *project) const
{
QList<Project *> result;
......@@ -1010,8 +1000,8 @@ void SessionManager::removeProjects(QList<Project *> remove)
m_file->m_depMap = resMap;
if (startupProject() == 0)
if (Project *newStartupProject = defaultStartupProject())
setStartupProject(newStartupProject);
if (!m_file->m_projects.isEmpty())
setStartupProject(m_file->m_projects.first());
}
void SessionManager::setValue(const QString &name, const QVariant &value)
......
......@@ -184,7 +184,6 @@ private:
bool recursiveDependencyCheck(const QString &newDep, const QString &checkDep) const;
QStringList dependencies(const QString &proName) const;
QStringList dependenciesOrder() const;
Project *defaultStartupProject() const;
void updateName(const QString &session);
......
......@@ -223,11 +223,6 @@ QList<ProjectExplorer::Project *> QmlProject::dependsOn()
return QList<Project *>();
}
bool QmlProject::isApplication() const
{
return true;
}
ProjectExplorer::BuildConfigWidget *QmlProject::createConfigWidget()
{
return 0;
......
......@@ -77,8 +77,6 @@ public:
QList<ProjectExplorer::Project *> dependsOn();
bool isApplication() const;
ProjectExplorer::BuildConfigWidget *createConfigWidget();
QList<ProjectExplorer::BuildConfigWidget*> subConfigWidgets();
......
......@@ -241,7 +241,6 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
m_nodesWatcher(new Internal::Qt4NodesWatcher(this)),
m_targetFactory(new Qt4TargetFactory(this)),
m_fileInfo(new Qt4ProjectFile(this, fileName, this)),
m_isApplication(true),
m_projectFiles(new Qt4ProjectFiles),
m_proFileOption(0),
m_asyncUpdateFutureInterface(0),
......@@ -820,14 +819,6 @@ void Qt4Project::asyncUpdate()
m_asyncUpdateState = AsyncUpdateInProgress;
}
/*!
Returns whether the project is an application, or has an application as a subproject.
*/
bool Qt4Project::isApplication() const
{
return m_isApplication;
}
ProjectExplorer::IProjectManager *Qt4Project::projectManager() const
{
return m_manager;
......@@ -1007,7 +998,6 @@ void Qt4Project::checkForNewApplicationProjects()
}
if (!found) {
qt4Target->addRunConfigurationForPath(qt4proFile->path());
m_isApplication = true;
}
}
}
......@@ -1035,7 +1025,6 @@ void Qt4Project::checkForDeletedApplicationProjects()
if (target->runConfigurations().isEmpty()) {
target->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(target));
m_isApplication = false;
}
}
}
......
......@@ -127,8 +127,6 @@ public:
QList<Core::IFile *> dependencies(); //NBS remove
QList<ProjectExplorer::Project *>dependsOn();
bool isApplication() const;
Internal::Qt4ProFileNode *rootProjectNode() const;
virtual QStringList files(FilesMode fileMode) const;
......@@ -208,7 +206,6 @@ private:
Internal::Qt4TargetFactory *m_targetFactory;
Qt4ProjectFile *m_fileInfo;
bool m_isApplication;
// Current configuration
QString m_oldQtIncludePath;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment