Show VCS topic in window title

Project tree root is not visible most of the time. Window title is more
useful.

Also shows topic for *current* open file rather than the project
(supporting submodules and externally opened files)

Change-Id: Id21be09c27beca1b0d37674513121a0e0e995feb
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Orgad Shaneh
2013-07-08 20:38:46 +03:00
committed by Orgad Shaneh
parent ab0c3da08f
commit 0b6b6b38cb
3 changed files with 22 additions and 2 deletions

View File

@@ -290,8 +290,10 @@ void StateListener::slotStateChanged()
}
// Assemble state and emit signal.
Core::IVersionControl *vc = state.currentFile.isEmpty() ? projectControl : fileControl;
if (!vc) // Need a repository to patch
state.clearPatchFile();
if (!vc) {
state.clearPatchFile(); // Need a repository to patch
Core::EditorManager::setWindowTitleVcsTopic(QString());
}
if (debug)
qDebug() << state << (vc ? vc->displayName() : QString(QLatin1String("No version control")));
emit stateChanged(state, vc);
@@ -581,6 +583,7 @@ void VcsBasePlugin::slotStateChanged(const VcsBase::Internal::State &newInternal
if (!d->m_state.equals(newInternalState)) {
d->m_state.setState(newInternalState);
updateActions(VcsEnabled);
Core::EditorManager::setWindowTitleVcsTopic(vc->vcsTopic(d->m_state.topLevel()));
}
} else {
// Some other VCS plugin or state changed: Reset us to empty state.