[geary/wip/789924-network-transition-redux: 57/64] Remove some unused and unclear Folder.OpenState values.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/789924-network-transition-redux: 57/64] Remove some unused and unclear Folder.OpenState values.
- Date: Sat, 3 Mar 2018 00:31:02 +0000 (UTC)
commit 05f676005d67283b40edcd76066b21b3ee085684
Author: Michael James Gratton <mike vee net>
Date: Mon Feb 26 23:35:39 2018 +1100
Remove some unused and unclear Folder.OpenState values.
src/engine/api/geary-folder.vala | 4 +---
src/engine/app/app-conversation-monitor.vala | 4 +---
src/engine/app/app-email-store.vala | 2 +-
.../imap-engine/imap-engine-email-prefetcher.vala | 4 ++--
.../imap-engine/imap-engine-minimal-folder.vala | 4 ++--
5 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/src/engine/api/geary-folder.vala b/src/engine/api/geary-folder.vala
index 97fc247..95768b0 100644
--- a/src/engine/api/geary-folder.vala
+++ b/src/engine/api/geary-folder.vala
@@ -58,10 +58,8 @@
public abstract class Geary.Folder : BaseObject {
public enum OpenState {
CLOSED,
- OPENING,
- REMOTE,
LOCAL,
- BOTH
+ REMOTE;
}
public enum OpenFailed {
diff --git a/src/engine/app/app-conversation-monitor.vala b/src/engine/app/app-conversation-monitor.vala
index 5aac3cb..3f111f1 100644
--- a/src/engine/app/app-conversation-monitor.vala
+++ b/src/engine/app/app-conversation-monitor.vala
@@ -457,11 +457,9 @@ public class Geary.App.ConversationMonitor : BaseObject {
switch (this.base_folder.get_open_state()) {
case Folder.OpenState.CLOSED:
case Folder.OpenState.LOCAL:
- case Folder.OpenState.OPENING:
flags = Folder.ListFlags.LOCAL_ONLY;
break;
- case Folder.OpenState.BOTH:
case Folder.OpenState.REMOTE:
flags = Folder.ListFlags.NONE;
break;
@@ -852,7 +850,7 @@ public class Geary.App.ConversationMonitor : BaseObject {
private void on_folder_opened(Geary.Folder.OpenState state, int count) {
// once remote is open, reseed with messages from the earliest ID to the latest
- if (state == Geary.Folder.OpenState.BOTH || state == Geary.Folder.OpenState.REMOTE)
+ if (state == Geary.Folder.OpenState.REMOTE)
operation_queue.add(new ReseedOperation(this, state.to_string()));
}
diff --git a/src/engine/app/app-email-store.vala b/src/engine/app/app-email-store.vala
index db107d2..f7a1a52 100644
--- a/src/engine/app/app-email-store.vala
+++ b/src/engine/app/app-email-store.vala
@@ -134,7 +134,7 @@ public class Geary.App.EmailStore : BaseObject {
if (count == 0)
continue;
- if (folders.get(path).get_open_state() == Geary.Folder.OpenState.BOTH) {
+ if (folders.get(path).get_open_state() == Geary.Folder.OpenState.REMOTE) {
if (!best_is_open) {
best_is_open = true;
best_count = 0;
diff --git a/src/engine/imap-engine/imap-engine-email-prefetcher.vala
b/src/engine/imap-engine/imap-engine-email-prefetcher.vala
index c46628e..eaafa4c 100644
--- a/src/engine/imap-engine/imap-engine-email-prefetcher.vala
+++ b/src/engine/imap-engine/imap-engine-email-prefetcher.vala
@@ -67,9 +67,9 @@ private class Geary.ImapEngine.EmailPrefetcher : Object {
private void on_local_expansion(Gee.Collection<Geary.EmailIdentifier> ids) {
// it's possible to be notified of an append prior to remote open; don't prefetch until
// that occurs
- if (folder.get_open_state() != Geary.Folder.OpenState.BOTH)
+ if (folder.get_open_state() != Geary.Folder.OpenState.REMOTE)
return;
-
+
// acquire here since .begin() only schedules for later
active_sem.acquire();
do_prepare_new_async.begin(ids);
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index 94a8adb..23f87b2 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -205,7 +205,7 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
return Geary.Folder.OpenState.CLOSED;
return (this.remote_session != null)
- ? Geary.Folder.OpenState.BOTH
+ ? Geary.Folder.OpenState.REMOTE
: Geary.Folder.OpenState.LOCAL;
}
@@ -991,7 +991,7 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
// notify any subscribers with similar information
notify_opened(
- Geary.Folder.OpenState.BOTH,
+ Geary.Folder.OpenState.REMOTE,
session.folder.properties.email_total
);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]