forked from qt-creator/qt-creator
ProjectExplorer: make currentProject static
This saves one function call compared to the instance()->currentProject() pattern and is typically less to type on the caller site. Change-Id: I65568f30205fc90e2aaca7e8e7f0192241df8c85 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -820,7 +820,7 @@ Project *SessionManager::projectForFile(const QString &fileName) const
|
||||
const QList<Project *> &projectList = projects();
|
||||
|
||||
// Check current project first
|
||||
Project *currentProject = ProjectExplorerPlugin::instance()->currentProject();
|
||||
Project *currentProject = ProjectExplorerPlugin::currentProject();
|
||||
if (currentProject && projectContainsFile(currentProject, fileName))
|
||||
return currentProject;
|
||||
|
||||
@@ -856,7 +856,7 @@ QString SessionManager::currentSession() const
|
||||
void SessionManager::updateWindowTitle()
|
||||
{
|
||||
if (isDefaultSession(m_sessionName)) {
|
||||
if (Project *currentProject = ProjectExplorerPlugin::instance()->currentProject())
|
||||
if (Project *currentProject = ProjectExplorerPlugin::currentProject())
|
||||
ICore::editorManager()->setWindowTitleAddition(currentProject->displayName());
|
||||
else
|
||||
ICore::editorManager()->setWindowTitleAddition(QString());
|
||||
|
||||
Reference in New Issue
Block a user