diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-03 04:25:00 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-03 04:25:00 +0200 |
commit | 662cc53859760c4a8a792fc3653eaf7ad6e89ab4 (patch) | |
tree | bc4ae9ffdc95b5ce01cb94d0f6505b06c9dfbbbc /OpenKeychain | |
parent | 00bbf8c26787d97f5ef5eed86ffa58d0522a576b (diff) | |
download | open-keychain-662cc53859760c4a8a792fc3653eaf7ad6e89ab4.tar.gz open-keychain-662cc53859760c4a8a792fc3653eaf7ad6e89ab4.tar.bz2 open-keychain-662cc53859760c4a8a792fc3653eaf7ad6e89ab4.zip |
clean up PgpImportExport a bit
Diffstat (limited to 'OpenKeychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java index 26c705347..dd0549adc 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java @@ -47,7 +47,6 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Iterator; -import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; public class PgpImportExport { @@ -116,11 +115,6 @@ public class PgpImportExport { } } - /** Imports keys from given data. If keyIds is given only those are imported */ - public ImportKeyResult importKeyRings(List<ParcelableKeyRing> entries) { - return importKeyRings(entries.iterator(), entries.size()); - } - public ImportKeyResult importKeyRings(Iterator<ParcelableKeyRing> entries, int num) { updateProgress(R.string.progress_importing, 0, 100); @@ -134,7 +128,11 @@ public class PgpImportExport { int position = 0; double progSteps = 100.0 / num; - for (ParcelableKeyRing entry : new IterableIterator<ParcelableKeyRing>(entries)) { + + // iterate over all entries + while (entries.hasNext()) { + ParcelableKeyRing entry = entries.next(); + // Has this action been cancelled? If so, don't proceed any further if (mCancelled != null && mCancelled.get()) { break; |