Remove StoreConfig

This commit is contained in:
cketti 2020-05-01 05:42:50 +02:00
parent 02049c5882
commit 767f7e0efe
9 changed files with 5 additions and 27 deletions

View file

@ -17,7 +17,6 @@ import android.text.TextUtils;
import com.fsck.k9.backend.api.SyncConfig.ExpungePolicy;
import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.NetworkType;
import com.fsck.k9.mail.store.StoreConfig;
import com.fsck.k9.mailstore.StorageManager;
import com.fsck.k9.mailstore.StorageManager.StorageProvider;
import org.jetbrains.annotations.NotNull;
@ -27,7 +26,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Account stores all of the settings for a single account defined by the user. Each account is defined by a UUID.
*/
public class Account implements BaseAccount, StoreConfig {
public class Account implements BaseAccount {
/**
* This local folder is used to store messages to be sent.
*/

View file

@ -31,7 +31,7 @@ class Pop3BackendFactory(
private fun createPop3Store(account: Account): Pop3Store {
val serverSettings = decodeStoreUri(account.storeUri)
return Pop3Store(serverSettings, account, trustedSocketFactory)
return Pop3Store(serverSettings, trustedSocketFactory)
}
private fun createSmtpTransport(account: Account): SmtpTransport {

View file

@ -31,7 +31,7 @@ class Pop3BackendFactory(
private fun createPop3Store(account: Account): Pop3Store {
val serverSettings = decodeStoreUri(account.storeUri)
return Pop3Store(serverSettings, account, trustedSocketFactory)
return Pop3Store(serverSettings, trustedSocketFactory)
}
private fun createSmtpTransport(account: Account): SmtpTransport {

View file

@ -6,7 +6,6 @@ import java.net.URISyntaxException;
import com.fsck.k9.mail.AuthType;
import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mail.store.StoreConfig;
import static com.fsck.k9.mail.helper.UrlEncodingHelper.encodeUtf8;

View file

@ -1,7 +1,6 @@
package com.fsck.k9.backend.webdav;
import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mail.store.StoreConfig;
import com.fsck.k9.mail.store.webdav.WebDavStoreSettings;
import java.net.URI;

View file

@ -1,6 +0,0 @@
package com.fsck.k9.mail.store;
public interface StoreConfig {
String getDraftsFolder();
}

View file

@ -11,11 +11,9 @@ import com.fsck.k9.mail.ConnectionSecurity;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mail.ssl.TrustedSocketFactory;
import com.fsck.k9.mail.store.StoreConfig;
public class Pop3Store {
private final StoreConfig storeConfig;
private final TrustedSocketFactory trustedSocketFactory;
private final String host;
private final int port;
@ -27,8 +25,7 @@ public class Pop3Store {
private Map<String, Pop3Folder> mFolders = new HashMap<>();
public Pop3Store(ServerSettings serverSettings, StoreConfig storeConfig, TrustedSocketFactory socketFactory) {
this.storeConfig = storeConfig;
public Pop3Store(ServerSettings serverSettings, TrustedSocketFactory socketFactory) {
trustedSocketFactory = socketFactory;
host = serverSettings.host;
port = serverSettings.port;
@ -60,10 +57,6 @@ public class Pop3Store {
}
}
StoreConfig getConfig() {
return storeConfig;
}
public Pop3Connection createConnection() throws MessagingException {
return new Pop3Connection(new StorePop3Settings(), trustedSocketFactory);
}

View file

@ -6,7 +6,6 @@ import com.fsck.k9.mail.FetchProfile.Item;
import com.fsck.k9.mail.MessageRetrievalListener;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.internet.BinaryTempFileBody;
import com.fsck.k9.mail.store.StoreConfig;
import org.junit.Before;
import org.junit.Test;
@ -34,7 +33,6 @@ public class Pop3FolderTest {
private Pop3Store mockStore;
private Pop3Connection mockConnection;
private StoreConfig mockStoreConfig;
private MessageRetrievalListener<Pop3Message> mockListener;
private Pop3Folder folder;
@ -42,9 +40,7 @@ public class Pop3FolderTest {
public void before() throws MessagingException {
mockStore = mock(Pop3Store.class);
mockConnection = mock(Pop3Connection.class);
mockStoreConfig = mock(StoreConfig.class);
mockListener = mock(MessageRetrievalListener.class);
when(mockStore.getConfig()).thenReturn(mockStoreConfig);
when(mockStore.createConnection()).thenReturn(mockConnection);
when(mockConnection.executeSimpleCommand(Pop3Commands.STAT_COMMAND)).thenReturn("+OK 10 0");
folder = new Pop3Folder(mockStore, Pop3Folder.INBOX);

View file

@ -14,7 +14,6 @@ import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mail.filter.Base64;
import com.fsck.k9.mail.ssl.TrustedSocketFactory;
import com.fsck.k9.mail.store.StoreConfig;
import org.junit.Before;
import org.junit.Test;
@ -52,7 +51,6 @@ public class Pop3StoreTest {
private Pop3Store store;
private StoreConfig mockStoreConfig = mock(StoreConfig.class);
private TrustedSocketFactory mockTrustedSocketFactory = mock(TrustedSocketFactory.class);
private Socket mockSocket = mock(Socket.class);
private OutputStream mockOutputStream = mock(OutputStream.class);
@ -66,7 +64,7 @@ public class Pop3StoreTest {
when(mockSocket.isClosed()).thenReturn(false);
when(mockSocket.getOutputStream()).thenReturn(mockOutputStream);
store = new Pop3Store(serverSettings, mockStoreConfig, mockTrustedSocketFactory);
store = new Pop3Store(serverSettings, mockTrustedSocketFactory);
}
@Test