diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2011-10-12 18:27:03 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2011-10-12 18:27:03 +0200 |
commit | 892e65bf603e66f426afee89b4ad3a491109af76 (patch) | |
tree | e143a855735d16998a23c383248e3015f7839652 /main/src/cgeo/geocaching/files | |
parent | 899a2ff5af58479506115fbd618ffb0b40aee5c1 (diff) | |
download | cgeo-892e65bf603e66f426afee89b4ad3a491109af76.zip cgeo-892e65bf603e66f426afee89b4ad3a491109af76.tar.gz cgeo-892e65bf603e66f426afee89b4ad3a491109af76.tar.bz2 |
fix progress counting for GPX import
Diffstat (limited to 'main/src/cgeo/geocaching/files')
-rw-r--r-- | main/src/cgeo/geocaching/files/ProgressInputStream.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/files/ProgressInputStream.java b/main/src/cgeo/geocaching/files/ProgressInputStream.java index a42a6fd..593949b 100644 --- a/main/src/cgeo/geocaching/files/ProgressInputStream.java +++ b/main/src/cgeo/geocaching/files/ProgressInputStream.java @@ -21,9 +21,8 @@ public class ProgressInputStream extends FilterInputStream { @Override public int read(byte[] buffer) throws IOException { - final int read = super.read(buffer); - progress += read; - return read; + return super.read(buffer); + // don't increment here, this calls another read implementation which we already measure } @Override @@ -34,7 +33,7 @@ public class ProgressInputStream extends FilterInputStream { } int getProgress() { - return progress / 2; + return progress; } } |