Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 550b2844 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #6613 from thundernest/remove_unused_code

Remove unused code/resources
parents d9080088 4d3a308b
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
package com.fsck.k9

fun interface SettingsChangeListener {
    fun onSettingsChanged()
}
+0 −55
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import java.util.concurrent.Future;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Process;
import android.os.SystemClock;
@@ -131,7 +130,6 @@ public class MessagingController {
    private final NotificationOperations notificationOperations;


    private MessagingListener checkMailListener = null;
    private volatile boolean stopped = false;


@@ -1182,16 +1180,6 @@ public class MessagingController {
        }
    }

    public void clearAllPending(final Account account) {
        try {
            Timber.w("Clearing pending commands!");
            LocalStore localStore = localStoreProvider.getInstance(account);
            localStore.removePendingCommands();
        } catch (MessagingException me) {
            Timber.e(me, "Unable to clear pending command");
        }
    }

    public void loadMessageRemotePartial(Account account, long folderId, String uid, MessagingListener listener) {
        put("loadMessageRemotePartial", listener, () ->
            loadMessageRemoteSynchronous(account, folderId, uid, listener, true)
@@ -1977,35 +1965,6 @@ public class MessagingController {
        });
    }

    @SuppressLint("NewApi") // used for debugging only
    public void debugClearMessagesLocally(final List<MessageReference> messages) {
        if (!K9.DEVELOPER_MODE) {
            throw new AssertionError("method must only be used in developer mode!");
        }

        actOnMessagesGroupedByAccountAndFolder(messages, new MessageActor() {

            @Override
            public void act(final Account account, final LocalFolder messageFolder,
                    final List<LocalMessage> accountMessages) {

                putBackground("debugClearLocalMessages", null, new Runnable() {
                    @Override
                    public void run() {
                        for (LocalMessage message : accountMessages) {
                            try {
                                message.debugClearLocalData();
                            } catch (MessagingException e) {
                                throw new AssertionError("clearing local message content failed!", e);
                            }
                        }
                    }
                });
            }
        });

    }

    private void deleteMessagesSynchronous(Account account, long folderId, List<LocalMessage> messages, boolean skipTrashFolder) {
        try {
            List<LocalMessage> localOnlyMessages = new ArrayList<>();
@@ -2492,20 +2451,6 @@ public class MessagingController {
        }
    }

    public MessagingListener getCheckMailListener() {
        return checkMailListener;
    }

    public void setCheckMailListener(MessagingListener checkMailListener) {
        if (this.checkMailListener != null) {
            removeListener(this.checkMailListener);
        }
        this.checkMailListener = checkMailListener;
        if (this.checkMailListener != null) {
            addListener(this.checkMailListener);
        }
    }

    public void clearNotifications(LocalSearch search) {
        put("clearNotifications", null, () -> {
            notificationOperations.clearNotifications(search);
+0 −4
Original line number Diff line number Diff line
@@ -324,10 +324,6 @@ public class LockableDatabase {
        delete(false);
    }

    public void recreate() {
        delete(true);
    }

    /**
     * @param recreate
     *            <code>true</code> if the DB should be recreated after delete
+0 −23
Original line number Diff line number Diff line
package com.fsck.k9.mailstore

import android.database.Cursor

internal fun <T> LockableDatabase.query(
    table: String,
    columns: Array<String>,
    selection: String?,
    vararg selectionArgs: String,
    block: (Cursor) -> T
): T {
    return execute(false) { db ->
        val cursor = db.query(table, columns, selection, selectionArgs, null, null, null)
        cursor.use(block)
    }
}

internal fun <T> LockableDatabase.rawQuery(sql: String, vararg selectionArgs: String, block: (Cursor) -> T): T {
    return execute(false) { db ->
        val cursor = db.rawQuery(sql, selectionArgs)
        cursor.use(block)
    }
}
+0 −11
Original line number Diff line number Diff line
@@ -49,15 +49,4 @@ object HtmlConverter {
    fun textToHtmlFragment(text: String): String {
        return TextToHtml.toHtmlFragment(text, retainOriginalWhitespace = false)
    }

    /**
     * Convert a plain text string into an HTML fragment.
     *
     * This does not convert consecutive spaces to a series of non-breaking spaces followed by a regular space.
     * Only use this in combination with CSS to properly display the whitespace.
     */
    @JvmStatic
    fun textToHtmlFragmentWithOriginalWhitespace(text: String): String {
        return TextToHtml.toHtmlFragment(text, retainOriginalWhitespace = true)
    }
}
Loading