From 2b68c20a2a8bf8361ca958001ee6c4dc4a1eb846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20M=C3=B6hn?= Date: Mon, 27 Oct 2014 18:43:56 +0100 Subject: [PATCH] SideBySide2: Show file name in window title again In the old side by side diff screen, the name of the file being diffed was shown in the window title. For some reason the code that set the window title wasn't adopted from PatchScreen into SideBySide2. Put the setting of the window title back in. Put it into onInitUI(), since this was the place where it had first stood in PatchScreen. SideBySide2 already displays the path on the page, so leave out the setPageTitle() from PatchScreen, because this would display that path again. Also don't obtain the file name by finding the last slash with lastIndexOf() and then taking the substring from there, but use FileInfo.getFileName() instead. Searching for "lastIndexOf('/')" in the whole project gives quite some occurences. I thought reusing something might be a good idea. Bug: Issue 2960 Change-Id: I12a280b8a437b60e4e2f779b81072117d45a1505 --- .../src/main/java/com/google/gerrit/client/diff/SideBySide2.java | 1 + 1 file changed, 1 insertion(+) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java index 881bcec888..20d4d69fe9 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java @@ -142,6 +142,7 @@ public class SideBySide2 extends Screen { protected void onInitUI() { super.onInitUI(); setHeaderVisible(false); + setWindowTitle(FileInfo.getFileName(path)); } @Override