aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget
diff options
context:
space:
mode:
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget')
-rw-r--r--OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyListAdapter.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyListAdapter.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyListAdapter.java
index 8e8d33886..61ca0e9d0 100644
--- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyListAdapter.java
+++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyListAdapter.java
@@ -159,8 +159,14 @@ public class KeyListAdapter extends CursorTreeAdapter {
}
ImageView signIcon = (ImageView) view.findViewById(R.id.ic_signKey);
- if (cursor.getInt(cursor.getColumnIndex(Keys.CAN_SIGN)) != 1) {
- signIcon.setVisibility(View.GONE);
+ boolean privateEmpty = false; //Don't show signing icon for master keys without private keys
+ //TODO: does this need to be done for encrypting icon? Does anyone use master key for encrypt?
+ if (cursor.getInt(cursor.getColumnIndex(Keys.IS_MASTER_KEY)) == 1) {
+ privateEmpty = PgpHelper.isSecretKeyPrivateEmpty(context,
+ cursor.getLong(cursor.getColumnIndex(Keys.KEY_ID)));
+ }
+ if (privateEmpty || cursor.getInt(cursor.getColumnIndex(Keys.CAN_SIGN)) != 1) {
+ signIcon.setVisibility(View.GONE);
} else {
signIcon.setVisibility(View.VISIBLE);
}
@@ -261,4 +267,4 @@ public class KeyListAdapter extends CursorTreeAdapter {
return mContext.getContentResolver().query(uri, projection, selection, null, sortOrder);
}
-} \ No newline at end of file
+}