1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

Code refactoring:

- Created "controller" and "mail.filter" package
- Moved a lot of classes to new/other packages
- Removed unused classes: NoSuchProviderException, MessageDateComparator
This commit is contained in:
cketti 2010-05-19 18:17:06 +00:00
parent 22ce159fe6
commit 58b8479612
58 changed files with 115 additions and 70 deletions

View File

@ -7,6 +7,7 @@ import android.net.ConnectivityManager;
import android.net.Uri;
import android.util.Log;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.MessagingException;

View File

@ -14,6 +14,8 @@ import android.util.Log;
import android.webkit.WebSettings;
import com.fsck.k9.activity.MessageCompose;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessagingException;

View File

@ -23,6 +23,8 @@ import com.fsck.k9.*;
import com.fsck.k9.activity.setup.AccountSettings;
import com.fsck.k9.activity.setup.AccountSetupBasics;
import com.fsck.k9.activity.setup.Prefs;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.mail.Flag;
import java.util.ArrayList;

View File

@ -6,8 +6,8 @@ import android.content.Context;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.MessagingListener;
import com.fsck.k9.R;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.service.MailService;
public class ActivityListener extends MessagingListener

View File

@ -12,6 +12,8 @@ import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.fsck.k9.*;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.MessagingException;
import java.util.ArrayList;

View File

@ -12,7 +12,6 @@ import android.widget.ListView;
import android.widget.Toast;
import com.fsck.k9.Account;
import com.fsck.k9.Identity;
import com.fsck.k9.K9ListActivity;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import java.util.List;

View File

@ -14,8 +14,10 @@
* limitations under the License.
*/
package com.fsck.k9;
package com.fsck.k9.activity;
import com.fsck.k9.R;
import com.fsck.k9.R.string;
import android.os.Bundle;
import android.app.Dialog;

View File

@ -9,7 +9,6 @@ import android.widget.EditText;
import android.widget.LinearLayout;
import com.fsck.k9.Account;
import com.fsck.k9.Identity;
import com.fsck.k9.K9Activity;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import java.util.List;

View File

@ -23,6 +23,8 @@ import com.fsck.k9.*;
import com.fsck.k9.Account.FolderMode;
import com.fsck.k9.activity.setup.AccountSettings;
import com.fsck.k9.activity.setup.FolderSettings;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.helper.power.TracingPowerManager;
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
import com.fsck.k9.mail.Flag;

View File

@ -1,4 +1,4 @@
package com.fsck.k9;
package com.fsck.k9.activity;
import android.app.Activity;
@ -9,7 +9,7 @@ import android.view.View;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.widget.ScrollView;
import com.fsck.k9.activity.DateFormatter;
import com.fsck.k9.K9;
public class K9Activity extends Activity

View File

@ -1,8 +1,8 @@
package com.fsck.k9;
package com.fsck.k9.activity;
import android.app.ListActivity;
import android.os.Bundle;
import com.fsck.k9.activity.DateFormatter;
import com.fsck.k9.K9;
public class K9ListActivity extends ListActivity

View File

@ -1,5 +1,6 @@
package com.fsck.k9;
package com.fsck.k9.activity;
import com.fsck.k9.K9;
import android.os.Bundle;
import android.preference.PreferenceActivity;

View File

@ -23,6 +23,9 @@ import android.view.Window;
import android.widget.AutoCompleteTextView.Validator;
import android.widget.*;
import com.fsck.k9.*;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.internet.*;

View File

@ -23,10 +23,13 @@ import android.widget.*;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.CompoundButton.OnCheckedChangeListener;
import com.fsck.k9.*;
import com.fsck.k9.MessagingController.SORT_TYPE;
import com.fsck.k9.activity.setup.Prefs;
import com.fsck.k9.activity.setup.AccountSettings;
import com.fsck.k9.activity.setup.FolderSettings;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.controller.MessagingController.SORT_TYPE;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.store.LocalStore;

View File

@ -26,6 +26,8 @@ import android.view.animation.TranslateAnimation;
import android.webkit.*;
import android.widget.*;
import com.fsck.k9.*;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.internet.MimeUtility;

View File

@ -12,10 +12,11 @@ import com.fsck.k9.*;
import com.fsck.k9.Account.FolderMode;
import com.fsck.k9.activity.ChooseFolder;
import com.fsck.k9.activity.ChooseIdentity;
import com.fsck.k9.activity.ColorPickerDialog;
import com.fsck.k9.activity.K9PreferenceActivity;
import com.fsck.k9.activity.ManageIdentities;
import com.fsck.k9.mail.Store;
import com.fsck.k9.service.MailService;
import com.fsck.k9.ColorPickerDialog;
public class AccountSettings extends K9PreferenceActivity
{

View File

@ -11,9 +11,9 @@ import android.widget.Button;
import android.widget.Toast;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.K9Activity;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.activity.K9Activity;
import java.net.URI;
/**

View File

@ -21,6 +21,8 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import com.fsck.k9.*;
import com.fsck.k9.activity.K9Activity;
import com.fsck.k9.helper.Utility;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URI;

View File

@ -15,6 +15,8 @@ import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.fsck.k9.*;
import com.fsck.k9.activity.K9Activity;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.mail.AuthenticationFailedException;
import com.fsck.k9.mail.CertificateValidationException;
import com.fsck.k9.mail.Store;

View File

@ -11,9 +11,9 @@ import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import com.fsck.k9.Account;
import com.fsck.k9.K9Activity;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.activity.K9Activity;
public class AccountSetupComposition extends K9Activity
{

View File

@ -14,6 +14,8 @@ import android.widget.*;
import com.fsck.k9.*;
import com.fsck.k9.activity.ChooseFolder;
import com.fsck.k9.activity.K9Activity;
import com.fsck.k9.helper.Utility;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;

View File

@ -13,6 +13,8 @@ import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import com.fsck.k9.*;
import com.fsck.k9.activity.K9Activity;
import com.fsck.k9.helper.Utility;
public class AccountSetupNames extends K9Activity implements OnClickListener
{

View File

@ -11,6 +11,7 @@ import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.Spinner;
import com.fsck.k9.*;
import com.fsck.k9.activity.K9Activity;
import com.fsck.k9.mail.Store;
public class AccountSetupOptions extends K9Activity implements OnClickListener

View File

@ -14,6 +14,8 @@ import android.view.ViewGroup;
import android.widget.*;
import android.widget.CompoundButton.OnCheckedChangeListener;
import com.fsck.k9.*;
import com.fsck.k9.activity.K9Activity;
import com.fsck.k9.helper.Utility;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;

View File

@ -10,6 +10,7 @@ import android.preference.Preference;
import android.util.Log;
import android.view.KeyEvent;
import com.fsck.k9.*;
import com.fsck.k9.activity.K9PreferenceActivity;
import com.fsck.k9.mail.Folder.FolderClass;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Store;

View File

@ -9,6 +9,7 @@ import android.os.Bundle;
import android.preference.*;
import android.view.KeyEvent;
import com.fsck.k9.*;
import com.fsck.k9.activity.K9PreferenceActivity;
/**
* Activity to configure the font size of the information displayed in the

View File

@ -10,10 +10,10 @@ import android.preference.ListPreference;
import android.preference.Preference;
import android.view.KeyEvent;
import com.fsck.k9.K9;
import com.fsck.k9.K9PreferenceActivity;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.activity.DateFormatter;
import com.fsck.k9.activity.K9PreferenceActivity;
import com.fsck.k9.service.MailService;
public class Prefs extends K9PreferenceActivity

View File

@ -1,7 +1,8 @@
package com.fsck.k9.mail;
package com.fsck.k9.controller;
import java.util.Comparator;
import com.fsck.k9.mail.Message;
public class MessageDateComparator implements Comparator<Message>
{

View File

@ -1,4 +1,6 @@
package com.fsck.k9.mail;
package com.fsck.k9.controller;
import com.fsck.k9.mail.Message;
public interface MessageRemovalListener
{

View File

@ -1,5 +1,7 @@
package com.fsck.k9.mail;
package com.fsck.k9.controller;
import com.fsck.k9.mail.Message;
public interface MessageRetrievalListener
{

View File

@ -1,5 +1,5 @@
package com.fsck.k9;
package com.fsck.k9.controller;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
@ -37,8 +37,19 @@ import android.os.PowerManager.WakeLock;
import android.text.TextUtils;
import android.util.Log;
import com.fsck.k9.Account;
import com.fsck.k9.AccountStats;
import com.fsck.k9.K9;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.SearchSpecification;
import com.fsck.k9.Account.FolderMode;
import com.fsck.k9.Account.Searchable;
import com.fsck.k9.R.drawable;
import com.fsck.k9.R.string;
import com.fsck.k9.activity.FolderList;
import com.fsck.k9.activity.MessageList;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.helper.power.TracingPowerManager;
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
import com.fsck.k9.mail.Address;
@ -46,8 +57,6 @@ import com.fsck.k9.mail.FetchProfile;
import com.fsck.k9.mail.Flag;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessageRemovalListener;
import com.fsck.k9.mail.MessageRetrievalListener;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Part;
import com.fsck.k9.mail.PushReceiver;

View File

@ -1,4 +1,4 @@
package com.fsck.k9;
package com.fsck.k9.controller;
import android.app.Application;
import android.content.Context;
@ -6,6 +6,8 @@ import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Log;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.helper.power.TracingPowerManager;
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
import com.fsck.k9.mail.Folder;

View File

@ -1,7 +1,10 @@
package com.fsck.k9;
package com.fsck.k9.controller;
import android.content.Context;
import com.fsck.k9.Account;
import com.fsck.k9.AccountStats;
import com.fsck.k9.BaseAccount;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.Part;

View File

@ -1,10 +1,10 @@
package com.fsck.k9;
package com.fsck.k9.helper;
import android.text.Editable;
import android.widget.EditText;
import android.widget.TextView;
import com.fsck.k9.codec.binary.Base64;
import com.fsck.k9.mail.filter.Base64;
import java.io.IOException;
import java.io.InputStream;

View File

@ -5,7 +5,7 @@ import android.text.util.Rfc822Token;
import android.text.util.Rfc822Tokenizer;
import android.util.Log;
import com.fsck.k9.K9;
import com.fsck.k9.Utility;
import com.fsck.k9.helper.Utility;
import org.apache.james.mime4j.codec.EncoderUtil;
import org.apache.james.mime4j.field.address.AddressList;
import org.apache.james.mime4j.field.address.Mailbox;

View File

@ -2,6 +2,7 @@ package com.fsck.k9.mail;
import com.fsck.k9.Account;
import com.fsck.k9.Preferences;
import com.fsck.k9.controller.MessageRetrievalListener;
public abstract class Folder

View File

@ -1,17 +0,0 @@
package com.fsck.k9.mail;
public class NoSuchProviderException extends MessagingException
{
public static final long serialVersionUID = -1;
public NoSuchProviderException(String message)
{
super(message);
}
public NoSuchProviderException(String message, Throwable throwable)
{
super(message, throwable);
}
}

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package com.fsck.k9.codec.binary;
package com.fsck.k9.mail.filter;
import org.apache.commons.codec.BinaryDecoder;
import org.apache.commons.codec.BinaryEncoder;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package com.fsck.k9.codec.binary;
package com.fsck.k9.mail.filter;
import java.io.FilterOutputStream;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package com.fsck.k9.mail.transport;
package com.fsck.k9.mail.filter;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -1,4 +1,4 @@
package com.fsck.k9.mail.transport;
package com.fsck.k9.mail.filter;
import java.io.FilterOutputStream;
import java.io.IOException;

View File

@ -1,5 +1,5 @@
package com.fsck.k9;
package com.fsck.k9.mail.filter;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,4 +1,4 @@
package com.fsck.k9.mail.transport;
package com.fsck.k9.mail.filter;
import java.io.FilterOutputStream;
import java.io.IOException;

View File

@ -1,5 +1,5 @@
package com.fsck.k9;
package com.fsck.k9.mail.filter;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,4 +1,4 @@
package com.fsck.k9.mail.transport;
package com.fsck.k9.mail.filter;
import java.io.FilterOutputStream;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package com.fsck.k9.mail.transport;
package com.fsck.k9.mail.filter;
import android.util.Config;
import android.util.Log;

View File

@ -1,8 +1,8 @@
package com.fsck.k9.mail.internet;
import com.fsck.k9.codec.binary.Base64OutputStream;
import com.fsck.k9.mail.Body;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.filter.Base64OutputStream;
import org.apache.commons.io.IOUtils;
import java.io.*;

View File

@ -1,7 +1,7 @@
package com.fsck.k9.mail.internet;
import com.fsck.k9.Utility;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.MessagingException;
import org.apache.james.mime4j.codec.EncoderUtil;

View File

@ -2,9 +2,9 @@ package com.fsck.k9.mail.store;
import android.util.Log;
import com.fsck.k9.K9;
import com.fsck.k9.FixedLengthInputStream;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.filter.FixedLengthInputStream;
import com.fsck.k9.mail.filter.PeekableInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.ParseException;

View File

@ -7,18 +7,19 @@ import android.net.NetworkInfo;
import android.os.PowerManager;
import android.util.Log;
import com.fsck.k9.Account;
import com.fsck.k9.FixedLengthInputStream;
import com.fsck.k9.K9;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.Utility;
import com.fsck.k9.controller.MessageRetrievalListener;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.helper.power.TracingPowerManager;
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.filter.CountingOutputStream;
import com.fsck.k9.mail.filter.EOLConvertingOutputStream;
import com.fsck.k9.mail.filter.FixedLengthInputStream;
import com.fsck.k9.mail.filter.PeekableInputStream;
import com.fsck.k9.mail.internet.*;
import com.fsck.k9.mail.store.ImapResponseParser.ImapList;
import com.fsck.k9.mail.store.ImapResponseParser.ImapResponse;
import com.fsck.k9.mail.transport.CountingOutputStream;
import com.fsck.k9.mail.transport.EOLConvertingOutputStream;
import com.jcraft.jzlib.JZlib;
import com.jcraft.jzlib.ZInputStream;
import com.jcraft.jzlib.ZOutputStream;

View File

@ -13,10 +13,12 @@ import android.util.Log;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.Preferences;
import com.fsck.k9.Utility;
import com.fsck.k9.codec.binary.Base64OutputStream;
import com.fsck.k9.controller.MessageRemovalListener;
import com.fsck.k9.controller.MessageRetrievalListener;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.filter.Base64OutputStream;
import com.fsck.k9.mail.internet.*;
import com.fsck.k9.provider.AttachmentProvider;
import org.apache.commons.io.IOUtils;

View File

@ -6,7 +6,8 @@ import android.util.Log;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.Utility;
import com.fsck.k9.controller.MessageRetrievalListener;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Folder.OpenMode;
import com.fsck.k9.mail.internet.MimeMessage;

View File

@ -4,11 +4,12 @@ import android.util.Log;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.Utility;
import com.fsck.k9.controller.MessageRetrievalListener;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Folder.OpenMode;
import com.fsck.k9.mail.filter.EOLConvertingOutputStream;
import com.fsck.k9.mail.internet.MimeMessage;
import com.fsck.k9.mail.transport.EOLConvertingOutputStream;
import com.fsck.k9.mail.transport.TrustedSocketFactory;
import org.apache.http.*;
import org.apache.http.auth.AuthScope;

View File

@ -3,10 +3,13 @@ package com.fsck.k9.mail.transport;
import android.util.Log;
import com.fsck.k9.K9;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.codec.binary.Base64;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.filter.Base64;
import com.fsck.k9.mail.filter.EOLConvertingOutputStream;
import com.fsck.k9.mail.filter.LineWrapOutputStream;
import com.fsck.k9.mail.filter.PeekableInputStream;
import com.fsck.k9.mail.filter.SmtpDataStuffing;
import com.fsck.k9.mail.store.TrustManagerFactory;
import javax.net.ssl.SSLContext;

View File

@ -5,10 +5,10 @@ import android.util.Log;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Transport;
import com.fsck.k9.mail.filter.PeekableInputStream;
import com.fsck.k9.mail.store.WebDavStore;
import java.io.OutputStream;

View File

@ -8,7 +8,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.fsck.k9.K9;
import com.fsck.k9.Utility;
import com.fsck.k9.helper.Utility;
import java.net.URI;
import java.net.URLEncoder;

View File

@ -18,10 +18,10 @@ import android.util.Log;
import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.MessagingController;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.Account.FolderMode;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.helper.AutoSyncHelper;
import com.fsck.k9.mail.Pusher;

View File

@ -7,6 +7,8 @@ import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Log;
import com.fsck.k9.*;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.helper.power.TracingPowerManager;
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;