Session Manager: Easier code flow

This commit is contained in:
dt
2010-09-15 13:49:43 +02:00
parent 4c108128b2
commit 11574611e6

View File

@@ -894,14 +894,14 @@ void SessionManager::handleCurrentEditorChange(Core::IEditor *editor)
void SessionManager::updateWindowTitle()
{
QString windowTitle = tr("Qt Creator");
if (!isDefaultSession(m_sessionName)) {
if (isDefaultSession(m_sessionName)) {
if (Project *currentProject = ProjectExplorerPlugin::instance()->currentProject())
windowTitle.prepend(currentProject->displayName() + " - ");
} else {
QString sessionName = m_sessionName;
if (sessionName.isEmpty())
sessionName = tr("Untitled");
windowTitle.prepend(sessionName + " - ");
} else {
if (Project *currentProject = ProjectExplorerPlugin::instance()->currentProject())
windowTitle.prepend(currentProject->displayName() + " - ");
}
if (m_core->editorManager()->currentEditor()) {
QFileInfo fi(m_core->editorManager()->currentEditor()->file()->fileName());