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
This commit is contained in:
Richard Möhn 2014-10-27 18:43:56 +01:00 committed by David Pursehouse
parent 08314c5fcb
commit 2b68c20a2a

View File

@ -142,6 +142,7 @@ public class SideBySide2 extends Screen {
protected void onInitUI() {
super.onInitUI();
setHeaderVisible(false);
setWindowTitle(FileInfo.getFileName(path));
}
@Override