diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-10-25 22:25:14 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-10-25 22:25:14 +0200 |
commit | 8dddc82f6990b3b2495f3ff74c73ac95aa83d0f7 (patch) | |
tree | 33bd1a9ba5b9d10331a148f8449de43d32476acf /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | 4f37c88ea7568ddbb864c599c12c130a21791d15 (diff) | |
parent | b9c05044655358c8eebd822030d68c76f754d6cb (diff) | |
download | open-keychain-8dddc82f6990b3b2495f3ff74c73ac95aa83d0f7.tar.gz open-keychain-8dddc82f6990b3b2495f3ff74c73ac95aa83d0f7.tar.bz2 open-keychain-8dddc82f6990b3b2495f3ff74c73ac95aa83d0f7.zip |
Merge branch 'development' of github.com:open-keychain/open-keychain into development
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java index f37702a56..6c81e9193 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java @@ -70,6 +70,7 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> { @TargetApi(Build.VERSION_CODES.HONEYCOMB) public void setData(List<ImportKeysListEntry> data) { + clear(); if (data != null) { this.mData = data; @@ -89,16 +90,24 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> { return mData; } + /** This method returns a list of all selected entries, with public keys sorted + * before secret keys, see ImportExportOperation for specifics. + * @see org.sufficientlysecure.keychain.operations.ImportExportOperation + */ public ArrayList<ImportKeysListEntry> getSelectedEntries() { ArrayList<ImportKeysListEntry> result = new ArrayList<ImportKeysListEntry>(); + ArrayList<ImportKeysListEntry> secrets = new ArrayList<ImportKeysListEntry>(); if (mData == null) { return result; } for (ImportKeysListEntry entry : mData) { if (entry.isSelected()) { - result.add(entry); + // add this entry to either the secret or the public list + (entry.isSecretKey() ? secrets : result).add(entry); } } + // add secret keys at the end of the list + result.addAll(secrets); return result; } |