ews-I#159 - EMFolderTreeModel: Prefer Inbox over other folder types
When an Inbox is marked as a Sent folder and the Inbox gets to the MailFolderCache before the folder tree, then the folder tree reads the "is sent folder" for the cached folder and then overrides the folder Inbox type to the Sent folder, which breaks the visual part in the folder tree. Closes https://gitlab.gnome.org/GNOME/evolution-ews/-/issues/159
This commit is contained in:
@ -1507,20 +1507,26 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model,
|
||||
flags = (flags & ~CAMEL_FOLDER_TYPE_MASK) |
|
||||
CAMEL_FOLDER_TYPE_INBOX;
|
||||
display_name = _("Inbox");
|
||||
folder_is_drafts = FALSE;
|
||||
folder_is_sent = FALSE;
|
||||
} else if (strcmp (fi->full_name, "Outbox") == 0) {
|
||||
flags = (flags & ~CAMEL_FOLDER_TYPE_MASK) |
|
||||
CAMEL_FOLDER_TYPE_OUTBOX;
|
||||
display_name = _("Outbox");
|
||||
folder_is_drafts = FALSE;
|
||||
folder_is_sent = FALSE;
|
||||
} else if (strcmp (fi->full_name, "Sent") == 0) {
|
||||
folder_is_sent = TRUE;
|
||||
display_name = _("Sent");
|
||||
}
|
||||
}
|
||||
|
||||
if (folder_is_drafts)
|
||||
flags = (flags & ~CAMEL_FOLDER_TYPE_MASK) | CAMEL_FOLDER_TYPE_DRAFTS;
|
||||
if (folder_is_sent)
|
||||
flags = (flags & ~CAMEL_FOLDER_TYPE_MASK) | CAMEL_FOLDER_TYPE_SENT;
|
||||
if ((flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_INBOX) {
|
||||
if (folder_is_drafts)
|
||||
flags = (flags & ~CAMEL_FOLDER_TYPE_MASK) | CAMEL_FOLDER_TYPE_DRAFTS;
|
||||
if (folder_is_sent)
|
||||
flags = (flags & ~CAMEL_FOLDER_TYPE_MASK) | CAMEL_FOLDER_TYPE_SENT;
|
||||
}
|
||||
|
||||
/* Choose an icon name for the folder. */
|
||||
icon_name = em_folder_tree_model_get_icon_name_for_folder_uri (model, uri, store, fi->full_name, &flags);
|
||||
|
Reference in New Issue
Block a user