Close folders in reverse order. Bug 778968

This commit is contained in:
Gautier Pelloux-Prayer 2017-02-20 18:18:58 +01:00
parent 21d4e4da05
commit 71ac4de367
2 changed files with 8 additions and 7 deletions

View file

@ -1636,8 +1636,8 @@ public class GearyController : Geary.BaseObject {
return null;
}
private void on_folders_available_unavailable(Gee.Collection<Geary.Folder>? available,
Gee.Collection<Geary.Folder>? unavailable) {
private void on_folders_available_unavailable(Gee.List<Geary.Folder>? available,
Gee.List<Geary.Folder>? unavailable) {
if (available != null && available.size > 0) {
foreach (Geary.Folder folder in available) {
main_window.folder_list.add_folder(folder);
@ -1671,7 +1671,8 @@ public class GearyController : Geary.BaseObject {
}
if (unavailable != null) {
foreach (Geary.Folder folder in unavailable) {
for (int i = (unavailable.size - 1); i >= 0; i--) {
Geary.Folder folder = unavailable[i];
main_window.folder_list.remove_folder(folder);
if (folder.account == current_account) {
if (main_window.main_toolbar.copy_folder_menu.has_folder(folder))

View file

@ -55,8 +55,8 @@ public abstract class Geary.Account : BaseObject {
* they're created later; they become unavailable when the account is
* closed or they're deleted later.
*
* Folders are ordered for the convenience of the caller from the top of the heirarchy to
* lower in the heirarchy. In other words, parents are listed before children, assuming the
* Folders are ordered for the convenience of the caller from the top of the hierarchy to
* lower in the hierarchy. In other words, parents are listed before children, assuming the
* lists are traversed in natural order.
*
* @see sort_by_path
@ -67,8 +67,8 @@ public abstract class Geary.Account : BaseObject {
/**
* Fired when folders are created or deleted.
*
* Folders are ordered for the convenience of the caller from the top of the heirarchy to
* lower in the heirarchy. In other words, parents are listed before children, assuming the
* Folders are ordered for the convenience of the caller from the top of the hierarchy to
* lower in the hierarchy. In other words, parents are listed before children, assuming the
* lists are traversed in natural order.
*
* @see sort_by_path