1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-02-25 07:01:50 -05:00

Cosmetic changes

- Grouped static fields and functions
- Renamed static fields to match code standard
This commit is contained in:
cketti 2011-06-06 21:10:14 +02:00
parent 9a3ce9e03e
commit 0e2afc38ef

View File

@ -29,17 +29,13 @@ public abstract class Store {
/** /**
* Remote stores indexed by Uri. * Remote stores indexed by Uri.
*/ */
private static HashMap<String, Store> mStores = new HashMap<String, Store>(); private static HashMap<String, Store> sStores = new HashMap<String, Store>();
/** /**
* Local stores indexed by UUid because the Uri may change due to migration to/from SD-card. * Local stores indexed by UUid because the Uri may change due to migration to/from SD-card.
*/ */
private static HashMap<String, Store> mLocalStores = new HashMap<String, Store>(); private static HashMap<String, Store> sLocalStores = new HashMap<String, Store>();
protected final Account mAccount;
protected Store(Account account) {
mAccount = account;
}
/** /**
* Get an instance of a remote mail store. * Get an instance of a remote mail store.
@ -51,7 +47,7 @@ public abstract class Store {
throw new RuntimeException("Asked to get non-local Store object but given LocalStore URI"); throw new RuntimeException("Asked to get non-local Store object but given LocalStore URI");
} }
Store store = mStores.get(uri); Store store = sStores.get(uri);
if (store == null) { if (store == null) {
if (uri.startsWith("imap")) { if (uri.startsWith("imap")) {
store = new ImapStore(account); store = new ImapStore(account);
@ -62,7 +58,7 @@ public abstract class Store {
} }
if (store != null) { if (store != null) {
mStores.put(uri, store); sStores.put(uri, store);
} }
} }
@ -78,15 +74,23 @@ public abstract class Store {
* @throws UnavailableStorageException if not {@link StorageProvider#isReady(Context)} * @throws UnavailableStorageException if not {@link StorageProvider#isReady(Context)}
*/ */
public synchronized static LocalStore getLocalInstance(Account account, Application application) throws MessagingException { public synchronized static LocalStore getLocalInstance(Account account, Application application) throws MessagingException {
Store store = mLocalStores.get(account.getUuid()); Store store = sLocalStores.get(account.getUuid());
if (store == null) { if (store == null) {
store = new LocalStore(account, application); store = new LocalStore(account, application);
mLocalStores.put(account.getUuid(), store); sLocalStores.put(account.getUuid(), store);
} }
return (LocalStore) store; return (LocalStore) store;
} }
protected final Account mAccount;
protected Store(Account account) {
mAccount = account;
}
public abstract Folder getFolder(String name); public abstract Folder getFolder(String name);
public abstract List <? extends Folder > getPersonalNamespaces(boolean forceListAll) throws MessagingException; public abstract List <? extends Folder > getPersonalNamespaces(boolean forceListAll) throws MessagingException;
@ -96,20 +100,23 @@ public abstract class Store {
public boolean isCopyCapable() { public boolean isCopyCapable() {
return false; return false;
} }
public boolean isMoveCapable() { public boolean isMoveCapable() {
return false; return false;
} }
public boolean isPushCapable() { public boolean isPushCapable() {
return false; return false;
} }
public boolean isSendCapable() { public boolean isSendCapable() {
return false; return false;
} }
public boolean isExpungeCapable() { public boolean isExpungeCapable() {
return false; return false;
} }
public void sendMessages(Message[] messages) throws MessagingException { public void sendMessages(Message[] messages) throws MessagingException {
} }