diff options
author | Ash Hughes <ashes-iontach@hotmail.com> | 2013-03-19 02:04:56 +0000 |
---|---|---|
committer | Ash Hughes <ashes-iontach@hotmail.com> | 2013-03-19 02:04:56 +0000 |
commit | 650b22d5e9512ede43b0c742799d49b061dda587 (patch) | |
tree | aa32b62b8496a1ff96f85e4673faa5dd8d8ead65 /OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java | |
parent | 2d856c5f0e4f0ba9e1973ad85fde14ad06a1133c (diff) | |
download | open-keychain-650b22d5e9512ede43b0c742799d49b061dda587.tar.gz open-keychain-650b22d5e9512ede43b0c742799d49b061dda587.tar.bz2 open-keychain-650b22d5e9512ede43b0c742799d49b061dda587.zip |
only sign keys if private key has capability
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java')
-rw-r--r-- | OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java index a3d9167a3..ae3adeed7 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/SelectSecretKeyFragment.java @@ -91,12 +91,22 @@ public class SelectSecretKeyFragment extends SherlockListFragment implements // sample only has one Loader, so we don't care about the ID. Uri baseUri = KeyRings.buildSecretKeyRingsUri(); + String CapFilter = null; + if (((SelectSecretKeyActivity)getActivity()).filterCertify == true) { + CapFilter = "(cert>0)"; + } + + // These are the rows that we will retrieve. long now = new Date().getTime() / 1000; String[] projection = new String[] { KeyRings._ID, KeyRings.MASTER_KEY_ID, UserIds.USER_ID, + "(SELECT COUNT(cert_keys." + Keys._ID + ") FROM " + Tables.KEYS + + " AS cert_keys WHERE cert_keys." + Keys.KEY_RING_ROW_ID + " = " + + KeychainDatabase.Tables.KEY_RINGS + "." + KeyRings._ID + " AND cert_keys." + + Keys.CAN_CERTIFY + " = '1') AS cert", "(SELECT COUNT(available_keys." + Keys._ID + ") FROM " + Tables.KEYS + " AS available_keys WHERE available_keys." + Keys.KEY_RING_ROW_ID + " = " + KeychainDatabase.Tables.KEY_RINGS + "." + KeyRings._ID @@ -127,7 +137,7 @@ public class SelectSecretKeyFragment extends SherlockListFragment implements // Now create and return a CursorLoader that will take care of // creating a Cursor for the data being displayed. - return new CursorLoader(getActivity(), baseUri, projection, null, null, orderBy); + return new CursorLoader(getActivity(), baseUri, projection, CapFilter, null, orderBy); } @Override |