add current editor filename (and, on macosx, proxy icon) to titlebar

This commit is contained in:
Joel Nordell
2009-05-21 14:11:13 -05:00
parent bb6f56f553
commit 69a99f0a40
2 changed files with 11 additions and 0 deletions

View File

@@ -393,6 +393,8 @@ SessionManager::SessionManager(QObject *parent)
this, SLOT(setEditorCodec(Core::IEditor *, QString)));
connect(ProjectExplorerPlugin::instance(), SIGNAL(currentProjectChanged(ProjectExplorer::Project *)),
this, SLOT(updateWindowTitle()));
connect(m_core->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(updateWindowTitle()));
}
SessionManager::~SessionManager()
@@ -921,6 +923,13 @@ void SessionManager::updateWindowTitle()
if (Project *currentProject = ProjectExplorerPlugin::instance()->currentProject())
windowTitle.prepend(currentProject->name() + " - ");
}
if (m_core->editorManager()->currentEditor()) {
QFileInfo fi(m_core->editorManager()->currentEditor()->file()->fileName());
windowTitle.prepend(fi.fileName() + " - ");
m_core->mainWindow()->setWindowFilePath(fi.absoluteFilePath());
} else {
m_core->mainWindow()->setWindowFilePath(QString());
}
m_core->mainWindow()->setWindowTitle(windowTitle);
}