Copy/Move message to Folder may not expand Public Folders
Coming from evolution-ews#93 (closed).
The Message->Copy/Move to Folder dialog expands all folders [*], to make it simpler to search for a particular folder even in a hierarchy, which is usually collapsed. The problem is that evolution-ews provides also a view on Public Folders, which are not real user folders and which can be particularly large, thus expanding these can lead to a long delay, due to checking their availability and subfolders.
That said, Message->Copy/Move to Folder dialog should not expand the Public Folders node, if any such exists.
One problem is that there's currently no way to recognize public folders from regular folders. In case of evolution-ews' Public Folders, it sets CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_NOSELECT
on it, thus it could be used as a hint (it may eventually collapse also Gmail's [Gmail]
folder, if it's relaxed to CAMEL_FOLDER_NOSELECT
only). Eventually a new enum value can be added into libcamel's CamelFolderInfoFlags (libcamel resides in evolution-data-server) and this new value would be used in evolution and be set by evolution-ews and evolution-mapi. Nonetheless, it's not necessary to add the new enum value, or it can be added if it's realized the existing flags are insufficient for this.
[*] the gtk_tree_view_expand_all() doesn't always expand all folders, which means there should be added some manual code to expand/collapse the nodes as needed. Such code may be aware of archive folders, thus this could be done in one go, instead of in two (the second is em_folder_selector_maybe_collapse_archive_folders
).
This custom traversar will expand or collapse the nodes according to the criteria. That's the reason why I mention also the archive folders collapsing, because the criteria is about folder flags and about folder type (being it an archive folder or not).