diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-04-16 17:29:31 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-04-16 17:29:36 +0200 |
commit | 66b8b86695bdeeec1d44289e30294825a0223a82 (patch) | |
tree | 7d22695c4305c024afd6647d09e9b0ec137a3786 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | cd8458f34dc60d9defad897342af2ddc592149d2 (diff) | |
download | open-keychain-66b8b86695bdeeec1d44289e30294825a0223a82.tar.gz open-keychain-66b8b86695bdeeec1d44289e30294825a0223a82.tar.bz2 open-keychain-66b8b86695bdeeec1d44289e30294825a0223a82.zip |
stripped support: add has_secret column to keys table
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
4 files changed, 14 insertions, 14 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 c60acf9a2..2cc3396ec 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -256,7 +256,7 @@ public class KeyListFragment extends Fragment KeyRings.IS_REVOKED, KeyRings.EXPIRY, KeyRings.VERIFIED, - KeyRings.HAS_SECRET + KeyRings.HAS_ANY_SECRET }; static final int INDEX_MASTER_KEY_ID = 1; @@ -264,10 +264,10 @@ public class KeyListFragment extends Fragment static final int INDEX_IS_REVOKED = 3; static final int INDEX_EXPIRY = 4; static final int INDEX_VERIFIED = 5; - static final int INDEX_HAS_SECRET = 6; + static final int INDEX_HAS_ANY_SECRET = 6; static final String ORDER = // IN THE COURT - KeyRings.HAS_SECRET + " DESC, " + KeyRings.USER_ID + " ASC"; + KeyRings.HAS_ANY_SECRET + " DESC, " + KeyRings.USER_ID + " ASC"; @Override @@ -518,7 +518,7 @@ public class KeyListFragment extends Fragment { // set edit button and revoked info, specific by key type - if (cursor.getInt(KeyListFragment.INDEX_HAS_SECRET) != 0) { + if (cursor.getInt(KeyListFragment.INDEX_HAS_ANY_SECRET) != 0) { // this is a secret key - show the edit mButton h.mStatusDivider.setVisibility(View.VISIBLE); h.mStatusLayout.setVisibility(View.VISIBLE); @@ -564,7 +564,7 @@ public class KeyListFragment extends Fragment throw new IllegalStateException("couldn't move cursor to position " + id); } - return mCursor.getInt(INDEX_HAS_SECRET) != 0; + return mCursor.getInt(INDEX_HAS_ANY_SECRET) != 0; } public long getMasterKeyId(int id) { if (!mCursor.moveToPosition(id)) { @@ -604,7 +604,7 @@ public class KeyListFragment extends Fragment throw new IllegalStateException("couldn't move cursor to position " + position); } - if (mCursor.getInt(KeyListFragment.INDEX_HAS_SECRET) != 0) { + if (mCursor.getInt(KeyListFragment.INDEX_HAS_ANY_SECRET) != 0) { { // set contact count int num = mCursor.getCount(); String contactsTotal = getResources().getQuantityString(R.plurals.n_contacts, num, num); @@ -643,7 +643,7 @@ public class KeyListFragment extends Fragment } // early breakout: all secret keys are assigned id 0 - if (mCursor.getInt(KeyListFragment.INDEX_HAS_SECRET) != 0) { + if (mCursor.getInt(KeyListFragment.INDEX_HAS_ANY_SECRET) != 0) { return 1L; } // otherwise, return the first character of the name as ID diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java index 47f4f52d7..5b46df8ae 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java @@ -117,10 +117,10 @@ public class SelectSecretKeyFragment extends ListFragment implements KeyRings.IS_REVOKED, KeyRings.CAN_CERTIFY, KeyRings.HAS_SIGN, - KeyRings.HAS_SECRET + KeyRings.HAS_ANY_SECRET }; - String where = KeyRings.HAS_SECRET + " = 1"; + String where = KeyRings.HAS_ANY_SECRET + " = 1"; // Now create and return a CursorLoader that will take care of // creating a Cursor for the data being displayed. diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java index 89f6a467b..f7bea33a0 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java @@ -158,13 +158,13 @@ public class ViewKeyMainFragment extends Fragment implements } static final String[] UNIFIED_PROJECTION = new String[] { - KeyRings._ID, KeyRings.MASTER_KEY_ID, KeyRings.HAS_SECRET, + KeyRings._ID, KeyRings.MASTER_KEY_ID, KeyRings.HAS_ANY_SECRET, KeyRings.USER_ID, KeyRings.FINGERPRINT, KeyRings.ALGORITHM, KeyRings.KEY_SIZE, KeyRings.CREATION, KeyRings.EXPIRY, }; static final int INDEX_UNIFIED_MKI = 1; - static final int INDEX_UNIFIED_HAS_SECRET = 2; + static final int INDEX_UNIFIED_HAS_ANY_SECRET = 2; static final int INDEX_UNIFIED_UID = 3; static final int INDEX_UNIFIED_FINGERPRINT = 4; static final int INDEX_UNIFIED_ALGORITHM = 5; @@ -225,7 +225,7 @@ public class ViewKeyMainFragment extends Fragment implements mEmail.setText(mainUserId[1]); mComment.setText(mainUserId[2]); - if (data.getInt(INDEX_UNIFIED_HAS_SECRET) != 0) { + if (data.getInt(INDEX_UNIFIED_HAS_ANY_SECRET) != 0) { mSecretKey.setTextColor(getResources().getColor(R.color.emphasis)); mSecretKey.setText(R.string.secret_key_yes); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java index 7b4a7be83..14f7b6810 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java @@ -91,10 +91,10 @@ public class DeleteKeyDialogFragment extends DialogFragment { HashMap<String, Object> data = new ProviderHelper(activity).getUnifiedData(masterKeyId, new String[]{ KeyRings.USER_ID, - KeyRings.HAS_SECRET + KeyRings.HAS_ANY_SECRET }, new int[]{ProviderHelper.FIELD_TYPE_STRING, ProviderHelper.FIELD_TYPE_INTEGER}); String userId = (String) data.get(KeyRings.USER_ID); - boolean hasSecret = ((Long) data.get(KeyRings.HAS_SECRET)) == 1; + boolean hasSecret = ((Long) data.get(KeyRings.HAS_ANY_SECRET)) == 1; // Set message depending on which key it is. mMainMessage.setText(getString( |