EditorManager: Sprinkle const over the window title logic

This amends 2ab5561b9a.

Change-Id: Ic7c36348e88b72d6c1fed75ca149958be332345e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Hugo Holgersson
2017-11-02 18:30:18 +01:00
parent 38e9a52f6c
commit 990ce20523
2 changed files with 5 additions and 5 deletions

View File

@@ -1766,7 +1766,7 @@ void EditorManagerPrivate::updateWindowTitleForDocument(IDocument *document, QWi
if (!documentName.isEmpty())
windowTitle.append(documentName);
QString filePath = document ? document->filePath().toFileInfo().absoluteFilePath()
const QString filePath = document ? document->filePath().toFileInfo().absoluteFilePath()
: QString();
const QString windowTitleAddition = d->m_titleAdditionHandler
? d->m_titleAdditionHandler(filePath)

View File

@@ -558,17 +558,17 @@ QString SessionManagerPrivate::sessionTitle(const QString &filePath)
}
QString SessionManagerPrivate::locationInProject(const QString &filePath) {
Project *project = SessionManager::projectForFile(Utils::FileName::fromString(filePath));
const Project *project = SessionManager::projectForFile(Utils::FileName::fromString(filePath));
if (!project)
return QString();
Utils::FileName file = Utils::FileName::fromString(filePath);
Utils::FileName parentDir = file.parentDir();
const Utils::FileName file = Utils::FileName::fromString(filePath);
const Utils::FileName parentDir = file.parentDir();
if (parentDir == project->projectDirectory())
return "@ " + project->displayName();
if (file.isChildOf(project->projectDirectory())) {
Utils::FileName dirInProject = parentDir.relativeChildPath(project->projectDirectory());
const Utils::FileName dirInProject = parentDir.relativeChildPath(project->projectDirectory());
return "(" + dirInProject.toUserOutput() + " @ " + project->displayName() + ")";
}