diff options
author | Thialfihar <thi@thialfihar.org> | 2014-04-02 01:51:02 +0200 |
---|---|---|
committer | Thialfihar <thi@thialfihar.org> | 2014-04-02 10:51:02 +0200 |
commit | d5983b324f107ef274d1af774787d0d5acf50131 (patch) | |
tree | ad156940b60aecce1ec3004bdcadb770fd6eb662 /OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java | |
parent | dd4a1e3f5239cc35a1abdc625238361350155191 (diff) | |
download | open-keychain-d5983b324f107ef274d1af774787d0d5acf50131.tar.gz open-keychain-d5983b324f107ef274d1af774787d0d5acf50131.tar.bz2 open-keychain-d5983b324f107ef274d1af774787d0d5acf50131.zip |
Adjust variable/member naming to conform to style guide
In some cases change member accessibility, so the naming matches.
Also, some key words were reordered to comply with JLS suggestions.
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java index 60dea2a41..02ebde1c8 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java @@ -51,12 +51,12 @@ public class DeleteKeyDialogFragment extends DialogFragment { public static final int MESSAGE_OKAY = 1; public static final int MESSAGE_ERROR = 0; - private boolean isSingleSelection = false; + private boolean mIsSingleSelection = false; - private TextView mainMessage; - private CheckBox checkDeleteSecret; - private LinearLayout deleteSecretKeyView; - private View inflateView; + private TextView mMainMessage; + private CheckBox mCheckDeleteSecret; + private LinearLayout mDeleteSecretKeyView; + private View mInflateView; private Messenger mMessenger; @@ -90,12 +90,12 @@ public class DeleteKeyDialogFragment extends DialogFragment { //Setup custom View to display in AlertDialog LayoutInflater inflater = activity.getLayoutInflater(); - inflateView = inflater.inflate(R.layout.view_key_delete_fragment, null); - builder.setView(inflateView); + mInflateView = inflater.inflate(R.layout.view_key_delete_fragment, null); + builder.setView(mInflateView); - deleteSecretKeyView = (LinearLayout) inflateView.findViewById(R.id.deleteSecretKeyView); - mainMessage = (TextView) inflateView.findViewById(R.id.mainMessage); - checkDeleteSecret = (CheckBox) inflateView.findViewById(R.id.checkDeleteSecret); + mDeleteSecretKeyView = (LinearLayout) mInflateView.findViewById(R.id.deleteSecretKeyView); + mMainMessage = (TextView) mInflateView.findViewById(R.id.mainMessage); + mCheckDeleteSecret = (CheckBox) mInflateView.findViewById(R.id.checkDeleteSecret); builder.setTitle(R.string.warning); @@ -103,7 +103,7 @@ public class DeleteKeyDialogFragment extends DialogFragment { if (keyRingRowIds.length == 1) { Uri dataUri; ArrayList<Long> publicKeyRings; //Any one will do - isSingleSelection = true; + mIsSingleSelection = true; long selectedRow = keyRingRowIds[0]; long keyType; @@ -119,16 +119,16 @@ public class DeleteKeyDialogFragment extends DialogFragment { } String userId = ProviderHelper.getUserId(activity, dataUri); - //Hide the Checkbox and TextView since this is a single selection,user will be notified thru message - deleteSecretKeyView.setVisibility(View.GONE); - //Set message depending on which key it is. - mainMessage.setText(getString(keyType == Id.type.secret_key ? R.string.secret_key_deletion_confirmation - : R.string.public_key_deletetion_confirmation, userId)); - - + // Hide the Checkbox and TextView since this is a single selection, + // user will be notified thru message + mDeleteSecretKeyView.setVisibility(View.GONE); + // Set message depending on which key it is. + mMainMessage.setText(getString(keyType == Id.type.secret_key ? + R.string.secret_key_deletion_confirmation : + R.string.public_key_deletetion_confirmation, userId)); } else { - deleteSecretKeyView.setVisibility(View.VISIBLE); - mainMessage.setText(R.string.key_deletion_confirmation_multi); + mDeleteSecretKeyView.setVisibility(View.VISIBLE); + mMainMessage.setText(R.string.key_deletion_confirmation_multi); } @@ -171,8 +171,9 @@ public class DeleteKeyDialogFragment extends DialogFragment { if (keyType == KeychainContract.KeyTypes.SECRET) { - if (checkDeleteSecret.isChecked() || isSingleSelection) { - ProviderHelper.deleteUnifiedKeyRing(activity, String.valueOf(masterKeyId), true); + if (mCheckDeleteSecret.isChecked() || mIsSingleSelection) { + ProviderHelper.deleteUnifiedKeyRing(activity, + String.valueOf(masterKeyId), true); } } else { ProviderHelper.deleteUnifiedKeyRing(activity, String.valueOf(masterKeyId), false); @@ -180,8 +181,10 @@ public class DeleteKeyDialogFragment extends DialogFragment { } //Check if the selected rows have actually been deleted - cursor = activity.getContentResolver().query(queryUri, projection, selection, null, null); - if (cursor == null || cursor.getCount() == 0 || !checkDeleteSecret.isChecked()) { + cursor = activity.getContentResolver().query( + queryUri, projection, selection, null, null); + if (cursor == null || cursor.getCount() == 0 || + !mCheckDeleteSecret.isChecked()) { isSuccessfullyDeleted = true; } } finally { |