From 8b11d1f74a67a36e818f531fdaa4783eba0d836f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sat, 1 Feb 2014 23:14:31 +0100 Subject: importing progress dialog language fixed --- .../org/sufficientlysecure/keychain/pgp/PgpImportExport.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java index 0e12a94f4..a7a574ee7 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java @@ -110,10 +110,11 @@ public class PgpImportExport { /** * Imports keys from given data. If keyIds is given only those are imported */ - public Bundle importKeyRings(List entries) throws PgpGeneralException, PGPException, IOException { + public Bundle importKeyRings(List entries) + throws PgpGeneralException, PGPException, IOException { Bundle returnData = new Bundle(); - updateProgress(R.string.progress_importing, 0, entries.size()); + updateProgress(R.string.progress_importing, 0, 100); int newKeys = 0; int oldKeys = 0; @@ -142,12 +143,12 @@ public class PgpImportExport { } else if (status == Id.return_value.bad) { ++badKeys; } - - position++; - updateProgress(position, entries.size()); } else { Log.e(Constants.TAG, "Object not recognized as PGPKeyRing!"); } + + position++; + updateProgress(position / entries.size() * 100, 100); } } catch (Exception e) { Log.e(Constants.TAG, "Exception on parsing key file!", e); -- cgit v1.2.3