From 59a446d7f41324ace6fbb573933d5c4f4a8350e1 Mon Sep 17 00:00:00 2001 From: iseki Date: Thu, 26 Mar 2015 11:59:18 +0900 Subject: [PATCH] Add brackets for if-else constructs and externalize the procedure as showMultiExportDialog. --- .../keychain/ui/KeyListFragment.java | 59 +++++++++++-------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index 8ef74a15f..9239a5466 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -241,30 +241,7 @@ public class KeyListFragment extends LoaderFragment } case R.id.menu_key_list_multi_export: { ids = mAdapter.getCurrentSelectedMasterKeyIds(); - mIdsForRepeatAskPassphrase = new ArrayList(); - for(long id: ids) { - try { - if (PassphraseCacheService.getCachedPassphrase( - getActivity(), id, id) == null) { - mIdsForRepeatAskPassphrase.add(Long.valueOf(id)); - } - } catch (PassphraseCacheService.KeyNotFoundException e) { - // This happens when the master key is stripped - // and ignore this key. - continue; - } - } - mIndex = 0; - if (mIdsForRepeatAskPassphrase.size() != 0) { - startPassphraseActivity(); - break; - } - long[] idsForMultiExport = new long[mIdsForRepeatAskPassphrase.size()]; - for(int i=0; i(); + for(long id: masterKeyIds) { + try { + if (PassphraseCacheService.getCachedPassphrase( + getActivity(), id, id) == null) { + mIdsForRepeatAskPassphrase.add(Long.valueOf(id)); + } + } catch (PassphraseCacheService.KeyNotFoundException e) { + // This happens when the master key is stripped + // and ignore this key. + continue; + } + } + mIndex = 0; + if (mIdsForRepeatAskPassphrase.size() != 0) { + startPassphraseActivity(); + break; + } + long[] idsForMultiExport = new long[mIdsForRepeatAskPassphrase.size()]; + for(int i=0; i