Commit 35fce3c2 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Move VCS topic next to file name

If no file is open, show it next to session/project name

New format is:
* foo.cpp [master] - session - Qt Creator
* session [master] - Qt Creator

Change-Id: I9945396ffadbffa8fca4b397dda33cfa54131997
Reviewed-by: default avatarPetar Perisin <petar.perisin@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 860584c1
......@@ -1881,15 +1881,21 @@ void EditorManager::updateWindowTitle()
{
QString windowTitle = tr("Qt Creator");
const QString dashSep = QLatin1String(" - ");
if (!d->m_titleVcsTopic.isEmpty())
windowTitle.prepend(QLatin1Char('[') + d->m_titleVcsTopic + QLatin1String("] - "));
if (!d->m_titleAddition.isEmpty())
windowTitle.prepend(d->m_titleAddition + dashSep);
QString vcsTopic;
IDocument *document = currentDocument();
if (!d->m_titleVcsTopic.isEmpty())
vcsTopic = QLatin1String(" [") + d->m_titleVcsTopic + QLatin1Char(']');
if (!d->m_titleAddition.isEmpty()) {
windowTitle.prepend(dashSep);
if (!document)
windowTitle.prepend(vcsTopic);
windowTitle.prepend(d->m_titleAddition);
}
if (document) {
QString editorName = document->displayName();
if (!editorName.isEmpty())
windowTitle.prepend(editorName + dashSep);
windowTitle.prepend(editorName + vcsTopic + dashSep);
QString filePath = QFileInfo(document->filePath()).absoluteFilePath();
if (!filePath.isEmpty())
ICore::mainWindow()->setWindowFilePath(filePath);
......
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