Commit b8ae31e6 authored by Daniel Teske's avatar Daniel Teske

Remove checking for a null sessionmanager.

That can't happen.

Change-Id: I05293e96e7a716fbaf5fd03aa182c723c9858a03
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 2a028413
......@@ -679,7 +679,6 @@ QList<ProjectExplorer::Project *> Parser::getProjectList() const
// check all projects
ProjectExplorer::SessionManager *sessionManager
= ProjectExplorer::ProjectExplorerPlugin::instance()->session();
QTC_ASSERT(sessionManager, return list);
list = sessionManager->projects();
......
......@@ -673,8 +673,6 @@ CppModelManager::CppModelManager(QObject *parent)
QTC_ASSERT(pe, return);
ProjectExplorer::SessionManager *session = pe->session();
QTC_ASSERT(session, return);
m_updateEditorSelectionsTimer = new QTimer(this);
m_updateEditorSelectionsTimer->setInterval(500);
m_updateEditorSelectionsTimer->setSingleShot(true);
......
......@@ -62,10 +62,7 @@ void AllProjectsFilter::updateFiles()
return;
m_filesUpToDate = true;
files().clear();
SessionManager *session = m_projectExplorer->session();
if (!session)
return;
foreach (Project *project, session->projects())
foreach (Project *project, m_projectExplorer->session()->projects())
files().append(project->files(Project::AllFiles));
qSort(files());
generateFileNames();
......
......@@ -73,7 +73,6 @@ QString AllProjectsFind::displayName() const
bool AllProjectsFind::isEnabled() const
{
return BaseFileFind::isEnabled()
&& m_plugin->session() != 0
&& m_plugin->session()->projects().count() > 0;
}
......@@ -81,7 +80,6 @@ Utils::FileIterator *AllProjectsFind::files(const QStringList &nameFilters,
const QVariant &additionalParameters) const
{
Q_UNUSED(additionalParameters)
QTC_ASSERT(m_plugin->session(), return new Utils::FileIterator());
return filesForProjects(nameFilters, m_plugin->session()->projects());
}
......
......@@ -83,7 +83,6 @@ QVariant CurrentProjectFind::additionalParameters() const
Utils::FileIterator *CurrentProjectFind::files(const QStringList &nameFilters,
const QVariant &additionalParameters) const
{
QTC_ASSERT(m_plugin->session(), return new Utils::FileIterator());
QTC_ASSERT(additionalParameters.isValid(), return new Utils::FileIterator());
QList<Project *> allProjects = m_plugin->session()->projects();
QString projectFile = additionalParameters.toString();
......
......@@ -155,10 +155,8 @@ void ModelManager::delayedInitialization()
}
ProjectExplorer::SessionManager *sessionManager = ProjectExplorer::ProjectExplorerPlugin::instance()->session();
if (sessionManager) {
connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(removeProjectInfo(ProjectExplorer::Project*)));
}
connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(removeProjectInfo(ProjectExplorer::Project*)));
}
void ModelManager::loadQmlTypeDescriptions()
......@@ -807,8 +805,6 @@ ModelManager::CppDataHash ModelManager::cppData() const
LibraryInfo ModelManager::builtins(const Document::Ptr &doc) const
{
ProjectExplorer::SessionManager *sessionManager = ProjectExplorer::ProjectExplorerPlugin::instance()->session();
if (!sessionManager)
return LibraryInfo();
ProjectExplorer::Project *project = sessionManager->projectForFile(doc->fileName());
if (!project)
return LibraryInfo();
......
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