ChangeScreen: Show file size increase/decrease for binary files

Reviewers are interested in the size of a change that was done to a
file. This is why for non-binary files the number of inserted/deleted
lines is shown. So far for binary files there was no indication of how
big the change was, but now the file size increase/decrease is shown.

Change-Id: Ie595754af1536ce430206c2553a7656f526d7769
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2015-10-09 14:17:21 +02:00
parent 640f984b54
commit 3b38262eae
4 changed files with 77 additions and 0 deletions

View File

@@ -30,6 +30,15 @@ public class FileInfo extends JavaScriptObject {
public final native boolean binary() /*-{ return this.binary || false; }-*/;
public final native String status() /*-{ return this.status; }-*/;
// JSNI methods cannot have 'long' as a parameter type or a return type and
// it's suggested to use double in this case:
// http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html#important
public final long sizeDelta() {
return (long)_sizeDelta();
}
private final native double _sizeDelta() /*-{ return this.size_delta || 0; }-*/;
public final native int _row() /*-{ return this._row }-*/;
public final native void _row(int r) /*-{ this._row = r }-*/;