[geary/mjog/121-search-tokenising: 4/7] Remove unused Geary.Folder::list_local_email_fields_async method



commit cc0fb9eef23bf1cab508e983edd5b2702357b73d
Author: Michael Gratton <mike vee net>
Date:   Sat Dec 14 16:42:33 2019 +1100

    Remove unused Geary.Folder::list_local_email_fields_async method

 src/engine/api/geary-folder.vala                   | 13 ---------
 src/engine/app/app-search-folder.vala              | 12 ---------
 .../imap-engine/imap-engine-minimal-folder.vala    |  9 -------
 src/engine/outbox/outbox-folder.vala               | 31 ----------------------
 test/engine/api/geary-folder-mock.vala             |  7 -----
 5 files changed, 72 deletions(-)
---
diff --git a/src/engine/api/geary-folder.vala b/src/engine/api/geary-folder.vala
index f2762f09..2602f87e 100644
--- a/src/engine/api/geary-folder.vala
+++ b/src/engine/api/geary-folder.vala
@@ -662,19 +662,6 @@ public abstract class Geary.Folder : BaseObject, Logging.Source {
         Gee.Collection<Geary.EmailIdentifier> ids, Geary.Email.Field required_fields, ListFlags flags,
         Cancellable? cancellable = null) throws Error;
 
-    /**
-     * Returns the locally available Geary.Email.Field fields for the specified emails.  If a
-     * list or fetch operation occurs on the emails that specifies a field not returned here,
-     * the Engine will either have to go out to the remote server to get it, or (if
-     * ListFlags.LOCAL_ONLY is specified) not return it to the caller.
-     *
-     * If the EmailIdentifier is unknown locally, it will not be present in the returned Map.
-     *
-     * The Folder must be opened prior to attempting this operation.
-     */
-    public abstract async Gee.Map<Geary.EmailIdentifier, Geary.Email.Field>? list_local_email_fields_async(
-        Gee.Collection<Geary.EmailIdentifier> ids, Cancellable? cancellable = null) throws Error;
-
     /**
      * Returns a single email that fulfills the required_fields flag at the ordered position in
      * the folder.  If the email_id is invalid for the folder's contents, an EngineError.NOT_FOUND
diff --git a/src/engine/app/app-search-folder.vala b/src/engine/app/app-search-folder.vala
index 2e11f5a2..5867dd0e 100644
--- a/src/engine/app/app-search-folder.vala
+++ b/src/engine/app/app-search-folder.vala
@@ -317,18 +317,6 @@ public class Geary.App.SearchFolder :
         );
     }
 
-    public override async Gee.Map<EmailIdentifier,Email.Field>? list_local_email_fields_async(
-        Gee.Collection<EmailIdentifier> list,
-        GLib.Cancellable? cancellable = null)
-        throws GLib.Error {
-        check_ids(list);
-        // TODO: This method is not currently called, but is required
-        // by the interface.  Before completing this feature, it
-        // should either be implemented either here or in
-        // AbstractLocalFolder.
-        error("Search folder does not implement list_local_email_fields_async");
-    }
-
     public override async Email fetch_email_async(EmailIdentifier fetch,
                                                   Email.Field required_fields,
                                                   Folder.ListFlags flags,
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala 
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index 37694c47..09f9b2ba 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -1226,15 +1226,6 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
         return !op.accumulator.is_empty ? op.accumulator : null;
     }
 
-    public override async Gee.Map<Geary.EmailIdentifier, Geary.Email.Field>? list_local_email_fields_async(
-        Gee.Collection<Geary.EmailIdentifier> ids, Cancellable? cancellable = null) throws Error {
-        check_open("list_local_email_fields_async");
-        check_ids("list_local_email_fields_async", ids);
-
-        return yield local_folder.list_email_fields_by_id_async(
-            (Gee.Collection<Geary.ImapDB.EmailIdentifier>) ids, ImapDB.Folder.ListFlags.NONE, cancellable);
-    }
-
     public override async Geary.Email fetch_email_async(Geary.EmailIdentifier id,
         Geary.Email.Field required_fields, Geary.Folder.ListFlags flags, Cancellable? cancellable = null)
         throws Error {
diff --git a/src/engine/outbox/outbox-folder.vala b/src/engine/outbox/outbox-folder.vala
index 6501a262..7d574d17 100644
--- a/src/engine/outbox/outbox-folder.vala
+++ b/src/engine/outbox/outbox-folder.vala
@@ -325,37 +325,6 @@ public class Geary.Outbox.Folder :
         return (list.size > 0) ? list : null;
     }
 
-    public override async Gee.Map<Geary.EmailIdentifier, Geary.Email.Field>?
-        list_local_email_fields_async(Gee.Collection<Geary.EmailIdentifier> ids,
-                                      GLib.Cancellable? cancellable = null)
-        throws GLib.Error {
-        check_open();
-
-        Gee.Map<Geary.EmailIdentifier, Geary.Email.Field> map = new Gee.HashMap<
-            Geary.EmailIdentifier, Geary.Email.Field>();
-        yield db.exec_transaction_async(Db.TransactionType.RO, (cx) => {
-            Db.Statement stmt = cx.prepare(
-                "SELECT id FROM SmtpOutboxTable WHERE ordering=?");
-            foreach (Geary.EmailIdentifier id in ids) {
-                EmailIdentifier? outbox_id = id as EmailIdentifier;
-                if (outbox_id == null)
-                    throw new EngineError.BAD_PARAMETERS("%s is not outbox EmailIdentifier", id.to_string());
-
-                stmt.reset(Db.ResetScope.CLEAR_BINDINGS);
-                stmt.bind_int64(0, outbox_id.ordering);
-
-                // merely checking for presence, all emails in outbox have same fields
-                Db.Result results = stmt.exec(cancellable);
-                if (!results.finished)
-                    map.set(outbox_id, Geary.Email.Field.ALL);
-            }
-
-            return Db.TransactionOutcome.DONE;
-        }, cancellable);
-
-        return (map.size > 0) ? map : null;
-    }
-
     public override async Email
         fetch_email_async(Geary.EmailIdentifier id,
                           Geary.Email.Field required_fields,
diff --git a/test/engine/api/geary-folder-mock.vala b/test/engine/api/geary-folder-mock.vala
index 29856044..1812e55f 100644
--- a/test/engine/api/geary-folder-mock.vala
+++ b/test/engine/api/geary-folder-mock.vala
@@ -110,13 +110,6 @@ public class Geary.MockFolder : Folder, MockObject {
         );
     }
 
-    public override async Gee.Map<Geary.EmailIdentifier, Geary.Email.Field>?
-        list_local_email_fields_async(Gee.Collection<Geary.EmailIdentifier> ids,
-                                      Cancellable? cancellable = null)
-    throws Error {
-        throw new EngineError.UNSUPPORTED("Mock method");
-    }
-
     public override async Geary.Email
         fetch_email_async(Geary.EmailIdentifier email_id,
                           Geary.Email.Field required_fields,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]