[geary/mjog/special-type-cleanup: 5/6] Geary.Imap.MailboxAttribute: Rename XLIST-specific attrs as such
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/special-type-cleanup: 5/6] Geary.Imap.MailboxAttribute: Rename XLIST-specific attrs as such
- Date: Tue, 31 Mar 2020 07:22:36 +0000 (UTC)
commit ec78ee50b408ccdb3b9f7560347965b87ffd6c58
Author: Michael Gratton <mike vee net>
Date: Fri Mar 27 18:47:34 2020 +1100
Geary.Imap.MailboxAttribute: Rename XLIST-specific attrs as such
src/engine/imap/command/imap-create-command.vala | 22 ++--
.../imap/response/imap-mailbox-attribute.vala | 127 ++++++++++-----------
.../imap/response/imap-mailbox-attributes.vala | 8 +-
.../imap/response/imap-mailbox-information.vala | 2 +-
4 files changed, 76 insertions(+), 83 deletions(-)
---
diff --git a/src/engine/imap/command/imap-create-command.vala
b/src/engine/imap/command/imap-create-command.vala
index c8a2112e..2ec68f3a 100644
--- a/src/engine/imap/command/imap-create-command.vala
+++ b/src/engine/imap/command/imap-create-command.vala
@@ -29,26 +29,26 @@ public class Geary.Imap.CreateCommand : Command {
private static MailboxAttribute? get_special_folder_type(Geary.SpecialFolderType type) {
switch (type) {
- case Geary.SpecialFolderType.TRASH:
- return MailboxAttribute.SPECIAL_FOLDER_TRASH;
+ case Geary.SpecialFolderType.ALL_MAIL:
+ return MailboxAttribute.SPECIAL_FOLDER_ALL;
+
+ case Geary.SpecialFolderType.ARCHIVE:
+ return MailboxAttribute.SPECIAL_FOLDER_ARCHIVE;
case Geary.SpecialFolderType.DRAFTS:
return MailboxAttribute.SPECIAL_FOLDER_DRAFTS;
- case Geary.SpecialFolderType.SENT:
- return MailboxAttribute.SPECIAL_FOLDER_SENT;
-
- case Geary.SpecialFolderType.ARCHIVE:
- return MailboxAttribute.SPECIAL_FOLDER_ARCHIVE;
+ case Geary.SpecialFolderType.FLAGGED:
+ return MailboxAttribute.SPECIAL_FOLDER_FLAGGED;
case Geary.SpecialFolderType.JUNK:
return MailboxAttribute.SPECIAL_FOLDER_JUNK;
- case Geary.SpecialFolderType.FLAGGED:
- return MailboxAttribute.SPECIAL_FOLDER_STARRED;
+ case Geary.SpecialFolderType.SENT:
+ return MailboxAttribute.SPECIAL_FOLDER_SENT;
- case Geary.SpecialFolderType.ALL_MAIL:
- return MailboxAttribute.SPECIAL_FOLDER_ALL;
+ case Geary.SpecialFolderType.TRASH:
+ return MailboxAttribute.SPECIAL_FOLDER_TRASH;
default:
return null;
diff --git a/src/engine/imap/response/imap-mailbox-attribute.vala
b/src/engine/imap/response/imap-mailbox-attribute.vala
index 91df675c..0070ae81 100644
--- a/src/engine/imap/response/imap-mailbox-attribute.vala
+++ b/src/engine/imap/response/imap-mailbox-attribute.vala
@@ -75,48 +75,72 @@ public class Geary.Imap.MailboxAttribute : Geary.Imap.Flag {
return _allows_new;
} }
- private static MailboxAttribute? _xlist_inbox = null;
- public static MailboxAttribute SPECIAL_FOLDER_INBOX { get {
- if (_xlist_inbox == null)
- _xlist_inbox = new MailboxAttribute("\\Inbox");
+ private static MailboxAttribute? _special_use_all = null;
+ public static MailboxAttribute SPECIAL_FOLDER_ALL { get {
+ return (_special_use_all != null) ? _special_use_all
+ : _special_use_all = new MailboxAttribute("\\All");
+ } }
- return _xlist_inbox;
+ private static MailboxAttribute? _special_use_archive = null;
+ public static MailboxAttribute SPECIAL_FOLDER_ARCHIVE { get {
+ return (_special_use_archive != null) ? _special_use_archive
+ : _special_use_archive = new MailboxAttribute("\\Archive");
} }
- private static MailboxAttribute? _xlist_all_mail = null;
- public static MailboxAttribute SPECIAL_FOLDER_ALL_MAIL { get {
- if (_xlist_all_mail == null)
- _xlist_all_mail = new MailboxAttribute("\\AllMail");
+ private static MailboxAttribute? _special_use_drafts = null;
+ public static MailboxAttribute SPECIAL_FOLDER_DRAFTS { get {
+ return (_special_use_drafts != null) ? _special_use_drafts
+ : _special_use_drafts = new MailboxAttribute("\\Drafts");
+ } }
- return _xlist_all_mail;
+ private static MailboxAttribute? _special_use_flagged = null;
+ public static MailboxAttribute SPECIAL_FOLDER_FLAGGED { get {
+ return (_special_use_flagged != null) ? _special_use_flagged
+ : _special_use_flagged = new MailboxAttribute("\\Flagged");
} }
- private static MailboxAttribute? _xlist_trash = null;
- public static MailboxAttribute SPECIAL_FOLDER_TRASH { get {
- if (_xlist_trash == null)
- _xlist_trash = new MailboxAttribute("\\Trash");
+ private static MailboxAttribute? _special_use_important = null;
+ public static MailboxAttribute SPECIAL_FOLDER_IMPORTANT { get {
+ return (_special_use_important != null) ? _special_use_important
+ : _special_use_important = new MailboxAttribute("\\Important");
+ } }
- return _xlist_trash;
+ private static MailboxAttribute? _special_use_junk = null;
+ public static MailboxAttribute SPECIAL_FOLDER_JUNK { get {
+ return (_special_use_junk != null) ? _special_use_junk
+ : _special_use_junk = new MailboxAttribute("\\Junk");
} }
- private static MailboxAttribute? _xlist_drafts = null;
- public static MailboxAttribute SPECIAL_FOLDER_DRAFTS { get {
- if (_xlist_drafts == null)
- _xlist_drafts = new MailboxAttribute("\\Drafts");
+ private static MailboxAttribute? _special_use_sent = null;
+ public static MailboxAttribute SPECIAL_FOLDER_SENT { get {
+ return (_special_use_sent != null) ? _special_use_sent
+ : _special_use_sent = new MailboxAttribute("\\Sent");
+ } }
- return _xlist_drafts;
+ private static MailboxAttribute? _special_use_trash = null;
+ public static MailboxAttribute SPECIAL_FOLDER_TRASH { get {
+ return (_special_use_trash != null) ? _special_use_trash
+ : _special_use_trash = new MailboxAttribute("\\Trash");
} }
- private static MailboxAttribute? _xlist_sent = null;
- public static MailboxAttribute SPECIAL_FOLDER_SENT { get {
- if (_xlist_sent == null)
- _xlist_sent = new MailboxAttribute("\\Sent");
+ private static MailboxAttribute? _xlist_inbox = null;
+ public static MailboxAttribute XLIST_INBOX { get {
+ if (_xlist_inbox == null)
+ _xlist_inbox = new MailboxAttribute("\\Inbox");
- return _xlist_sent;
+ return _xlist_inbox;
+ } }
+
+ private static MailboxAttribute? _xlist_all_mail = null;
+ public static MailboxAttribute XLIST_ALL_MAIL { get {
+ if (_xlist_all_mail == null)
+ _xlist_all_mail = new MailboxAttribute("\\AllMail");
+
+ return _xlist_all_mail;
} }
private static MailboxAttribute? _xlist_spam = null;
- public static MailboxAttribute SPECIAL_FOLDER_SPAM { get {
+ public static MailboxAttribute XLIST_SPAM { get {
if (_xlist_spam == null)
_xlist_spam = new MailboxAttribute("\\Spam");
@@ -124,44 +148,13 @@ public class Geary.Imap.MailboxAttribute : Geary.Imap.Flag {
} }
private static MailboxAttribute? _xlist_starred = null;
- public static MailboxAttribute SPECIAL_FOLDER_STARRED { get {
+ public static MailboxAttribute XLIST_STARRED { get {
if (_xlist_starred == null)
_xlist_starred = new MailboxAttribute("\\Starred");
return _xlist_starred;
} }
- private static MailboxAttribute? _xlist_important = null;
- public static MailboxAttribute SPECIAL_FOLDER_IMPORTANT { get {
- if (_xlist_important == null)
- _xlist_important = new MailboxAttribute("\\Important");
-
- return _xlist_important;
- } }
-
- private static MailboxAttribute? _special_use_all = null;
- public static MailboxAttribute SPECIAL_FOLDER_ALL { get {
- return (_special_use_all != null) ? _special_use_all
- : _special_use_all = new MailboxAttribute("\\All");
- } }
-
- private static MailboxAttribute? _special_use_archive = null;
- public static MailboxAttribute SPECIAL_FOLDER_ARCHIVE { get {
- return (_special_use_archive != null) ? _special_use_archive
- : _special_use_archive = new MailboxAttribute("\\Archive");
- } }
-
- private static MailboxAttribute? _special_use_flagged = null;
- public static MailboxAttribute SPECIAL_FOLDER_FLAGGED { get {
- return (_special_use_flagged != null) ? _special_use_flagged
- : _special_use_flagged = new MailboxAttribute("\\Flagged");
- } }
-
- private static MailboxAttribute? _special_use_junk = null;
- public static MailboxAttribute SPECIAL_FOLDER_JUNK { get {
- return (_special_use_junk != null) ? _special_use_junk
- : _special_use_junk = new MailboxAttribute("\\Junk");
- } }
public MailboxAttribute(string value) {
base (value);
@@ -177,18 +170,18 @@ public class Geary.Imap.MailboxAttribute : Geary.Imap.Flag {
to_init = HAS_NO_CHILDREN;
to_init = HAS_CHILDREN;
to_init = ALLOWS_NEW;
- to_init = SPECIAL_FOLDER_ALL_MAIL;
- to_init = SPECIAL_FOLDER_DRAFTS;
- to_init = SPECIAL_FOLDER_IMPORTANT;
- to_init = SPECIAL_FOLDER_INBOX;
- to_init = SPECIAL_FOLDER_SENT;
- to_init = SPECIAL_FOLDER_SPAM;
- to_init = SPECIAL_FOLDER_STARRED;
- to_init = SPECIAL_FOLDER_TRASH;
to_init = SPECIAL_FOLDER_ALL;
to_init = SPECIAL_FOLDER_ARCHIVE;
+ to_init = SPECIAL_FOLDER_DRAFTS;
to_init = SPECIAL_FOLDER_FLAGGED;
+ to_init = SPECIAL_FOLDER_IMPORTANT;
to_init = SPECIAL_FOLDER_JUNK;
+ to_init = SPECIAL_FOLDER_SENT;
+ to_init = SPECIAL_FOLDER_TRASH;
+ to_init = XLIST_ALL_MAIL;
+ to_init = XLIST_INBOX;
+ to_init = XLIST_SPAM;
+ to_init = XLIST_STARRED;
}
-}
+}
diff --git a/src/engine/imap/response/imap-mailbox-attributes.vala
b/src/engine/imap/response/imap-mailbox-attributes.vala
index ce1d8fb9..c37f9007 100644
--- a/src/engine/imap/response/imap-mailbox-attributes.vala
+++ b/src/engine/imap/response/imap-mailbox-attributes.vala
@@ -59,10 +59,10 @@ public class Geary.Imap.MailboxAttributes : Geary.Imap.Flags {
* {@link Geary.SpecialFolderType}.
*/
public Geary.SpecialFolderType get_special_folder_type() {
- if (contains(MailboxAttribute.SPECIAL_FOLDER_INBOX))
+ if (contains(MailboxAttribute.XLIST_INBOX))
return Geary.SpecialFolderType.INBOX;
- if (contains(MailboxAttribute.SPECIAL_FOLDER_ALL_MAIL))
+ if (contains(MailboxAttribute.XLIST_ALL_MAIL))
return Geary.SpecialFolderType.ALL_MAIL;
if (contains(MailboxAttribute.SPECIAL_FOLDER_TRASH))
@@ -77,10 +77,10 @@ public class Geary.Imap.MailboxAttributes : Geary.Imap.Flags {
if (contains(MailboxAttribute.SPECIAL_FOLDER_JUNK))
return Geary.SpecialFolderType.JUNK;
- if (contains(MailboxAttribute.SPECIAL_FOLDER_SPAM))
+ if (contains(MailboxAttribute.XLIST_SPAM))
return Geary.SpecialFolderType.JUNK;
- if (contains(MailboxAttribute.SPECIAL_FOLDER_STARRED))
+ if (contains(MailboxAttribute.XLIST_STARRED))
return Geary.SpecialFolderType.FLAGGED;
if (contains(MailboxAttribute.SPECIAL_FOLDER_IMPORTANT))
diff --git a/src/engine/imap/response/imap-mailbox-information.vala
b/src/engine/imap/response/imap-mailbox-information.vala
index 80929818..ba155f17 100644
--- a/src/engine/imap/response/imap-mailbox-information.vala
+++ b/src/engine/imap/response/imap-mailbox-information.vala
@@ -77,7 +77,7 @@ public class Geary.Imap.MailboxInformation : BaseObject {
// Inbox name, otherwise decode it
MailboxSpecifier? specifier =
(canonical_inbox &&
- Geary.Imap.MailboxAttribute.SPECIAL_FOLDER_INBOX in attributes)
+ Geary.Imap.MailboxAttribute.XLIST_INBOX in attributes)
? MailboxSpecifier.inbox
: new MailboxSpecifier.from_parameter(mailbox);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]