Refactoring

This commit is contained in:
M66B 2023-11-18 09:58:29 +01:00
parent 98195890cb
commit 658a484e4f
5 changed files with 16 additions and 16 deletions

View File

@ -3733,7 +3733,7 @@ public class FragmentCompose extends FragmentBase {
pgpLoader.serial().execute(this, args, "compose:pgp"); pgpLoader.serial().execute(this, args, "compose:pgp");
} }
private final SimpleTask<Object> pgpLoader = new LoaderComposePgp() { private final SimpleTask<Object> pgpLoader = new TaskComposePgp() {
@Override @Override
protected void onPreExecute(Bundle args) { protected void onPreExecute(Bundle args) {
setBusy(true); setBusy(true);
@ -3804,7 +3804,7 @@ public class FragmentCompose extends FragmentBase {
sMimeLoader.serial().execute(this, args, "compose:s/mime"); sMimeLoader.serial().execute(this, args, "compose:s/mime");
} }
private final SimpleTask<Void> sMimeLoader = new LoaderComposeSMime() { private final SimpleTask<Void> sMimeLoader = new TaskComposeSMime() {
@Override @Override
protected void onPreExecute(Bundle args) { protected void onPreExecute(Bundle args) {
setBusy(true); setBusy(true);
@ -4259,10 +4259,10 @@ public class FragmentCompose extends FragmentBase {
args.putBundle("extras", extras); args.putBundle("extras", extras);
Log.i("Run execute id=" + working + " reason=" + reason); Log.i("Run execute id=" + working + " reason=" + reason);
actionLoader.execute(this, args, "compose:action:" + LoaderComposeAction.getActionName(action)); actionLoader.execute(this, args, "compose:action:" + TaskComposeAction.getActionName(action));
} }
private final SimpleTask<ComposeHelper.DraftData> draftLoader = new LoaderComposeDraft() { private final SimpleTask<ComposeHelper.DraftData> draftLoader = new TaskComposeDraft() {
@Override @Override
protected void onExecuted(Bundle args, final ComposeHelper.DraftData data) { protected void onExecuted(Bundle args, final ComposeHelper.DraftData data) {
final String action = getArguments().getString("action"); final String action = getArguments().getString("action");
@ -4614,7 +4614,7 @@ public class FragmentCompose extends FragmentBase {
} }
}.serial(); }.serial();
private final SimpleTask<EntityMessage> actionLoader = new LoaderComposeAction() { private final SimpleTask<EntityMessage> actionLoader = new TaskComposeAction() {
@Override @Override
protected void onPreExecute(Bundle args) { protected void onPreExecute(Bundle args) {
if (args.getBundle("extras").getBoolean("silent")) if (args.getBundle("extras").getBoolean("silent"))
@ -4653,7 +4653,7 @@ public class FragmentCompose extends FragmentBase {
boolean needsEncryption = args.getBoolean("needsEncryption"); boolean needsEncryption = args.getBoolean("needsEncryption");
int action = args.getInt("action"); int action = args.getInt("action");
Log.i("Loaded action id=" + draft.id + Log.i("Loaded action id=" + draft.id +
" action=" + LoaderComposeAction.getActionName(action) + " encryption=" + needsEncryption); " action=" + TaskComposeAction.getActionName(action) + " encryption=" + needsEncryption);
int toPos = etTo.getSelectionStart(); int toPos = etTo.getSelectionStart();
int ccPos = etCc.getSelectionStart(); int ccPos = etCc.getSelectionStart();

View File

@ -62,7 +62,7 @@ import javax.mail.Session;
import javax.mail.internet.AddressException; import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress; import javax.mail.internet.InternetAddress;
public abstract class LoaderComposeAction extends SimpleTask<EntityMessage> { public abstract class TaskComposeAction extends SimpleTask<EntityMessage> {
private static final int MAX_REASONABLE_SIZE = 5 * 1024 * 1024; private static final int MAX_REASONABLE_SIZE = 5 * 1024 * 1024;
@Override @Override
@ -754,15 +754,15 @@ public abstract class LoaderComposeAction extends SimpleTask<EntityMessage> {
} }
protected Pair<Integer, List<EntityAttachment>> get() { protected Pair<Integer, List<EntityAttachment>> get() {
throw new NotImplementedException("LoaderAction"); throw new NotImplementedException(this.getClass().getName());
} }
protected void set(Integer plain_only, List<EntityAttachment> attachments) { protected void set(Integer plain_only, List<EntityAttachment> attachments) {
throw new NotImplementedException("LoaderAction"); throw new NotImplementedException(this.getClass().getName());
} }
protected void toast(String feedback) { protected void toast(String feedback) {
throw new NotImplementedException("LoaderAction"); throw new NotImplementedException(this.getClass().getName());
} }
private void checkAddress(InternetAddress[] addresses, Context context) throws AddressException { private void checkAddress(InternetAddress[] addresses, Context context) throws AddressException {

View File

@ -55,7 +55,7 @@ import biweekly.ICalendar;
import biweekly.component.VEvent; import biweekly.component.VEvent;
import biweekly.property.Organizer; import biweekly.property.Organizer;
public abstract class LoaderComposeDraft extends SimpleTask<ComposeHelper.DraftData> { public abstract class TaskComposeDraft extends SimpleTask<ComposeHelper.DraftData> {
private static final int MAX_QUOTE_LEVEL = 5; private static final int MAX_QUOTE_LEVEL = 5;
@Override @Override
@ -974,10 +974,10 @@ public abstract class LoaderComposeDraft extends SimpleTask<ComposeHelper.DraftD
@Override @Override
protected void onException(Bundle args, Throwable ex) { protected void onException(Bundle args, Throwable ex) {
throw new NotImplementedException("LoaderDraft"); throw new NotImplementedException(this.getClass().getName());
} }
protected void set(Integer plain_only, List<EntityAttachment> attachments) { protected void set(Integer plain_only, List<EntityAttachment> attachments) {
throw new NotImplementedException("LoaderDraft"); throw new NotImplementedException(this.getClass().getName());
} }
} }

View File

@ -56,7 +56,7 @@ import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeUtility; import javax.mail.internet.MimeUtility;
public class LoaderComposePgp extends SimpleTask<Object> { public class TaskComposePgp extends SimpleTask<Object> {
private String[] pgpUserIds; private String[] pgpUserIds;
private long[] pgpKeyIds; private long[] pgpKeyIds;
private long pgpSignKeyId; private long pgpSignKeyId;
@ -380,6 +380,6 @@ public class LoaderComposePgp extends SimpleTask<Object> {
@Override @Override
protected void onException(Bundle args, Throwable ex) { protected void onException(Bundle args, Throwable ex) {
throw new NotImplementedException("LoaderDraft"); throw new NotImplementedException(this.getClass().getName());
} }
} }

View File

@ -79,7 +79,7 @@ import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart; import javax.mail.internet.MimeMultipart;
import javax.mail.util.ByteArrayDataSource; import javax.mail.util.ByteArrayDataSource;
public class LoaderComposeSMime extends SimpleTask<Void> { public class TaskComposeSMime extends SimpleTask<Void> {
@Override @Override
protected Void onExecute(Context context, Bundle args) throws Throwable { protected Void onExecute(Context context, Bundle args) throws Throwable {
long id = args.getLong("id"); long id = args.getLong("id");