Bug 1359410 Comment 55 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Right, it may be hard using existing methods, but if we are allowed to make a new method that notifies the account manager of the change, it could work.

Protz, please try the attached patch and from your new function setOrder() call MailServices.accounts.reorderAccount(finalList) instead of setting the mail.accountmanager.accounts pref and restarting. The finalList is the array you construct from accountIts and missing arrays concatenated. It should contain all existing accounts. You can keep managing mail.accountmanager.accounts.ordered in setOrder exactly as it is.
Right, it may be hard using existing methods, but if we are allowed to make a new method that notifies the account manager of the change, it could work.

Protz, please try the attached patch and from your new function setOrder() call MailServices.accounts.reorderAccounts(finalList) instead of setting the mail.accountmanager.accounts pref and restarting. The finalList is the array you construct from accountIds and missing arrays concatenated. It should contain all existing accounts. You can keep managing mail.accountmanager.accounts.ordered in setOrder exactly as it is.
You still need to force refreshing the folder pane, but maybe now the foldertree.mode = mode could work.

Back to Bug 1359410 Comment 55