diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp')
-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; |