[evolution] Mail Accounts in Preferences not always properly sorted



commit 61e858d832f620dcd35e0321741730045b491af0
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 14 15:33:08 2018 +0200

    Mail Accounts in Preferences not always properly sorted
    
    When Evolution had been started in other than Mail view and Preferences
    had been called, then the Mail Accounts section had not properly sorted
    accounts. These had been sorted only after the Mail view had been
    entered at least once. This change ensures the sorting even without
    entering the Mail view.

 src/modules/mail/em-account-prefs.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/modules/mail/em-account-prefs.c b/src/modules/mail/em-account-prefs.c
index 92d224e84b..89dc165157 100644
--- a/src/modules/mail/em-account-prefs.c
+++ b/src/modules/mail/em-account-prefs.c
@@ -247,6 +247,7 @@ em_account_prefs_new (EPreferencesWindow *window)
        EMailAccountStore *account_store;
        EMailBackend *backend;
        EMailSession *session;
+       GError *error = NULL;
 
        /* XXX Figure out a better way to get the mail backend. */
        shell = e_preferences_window_get_shell (window);
@@ -257,6 +258,12 @@ em_account_prefs_new (EPreferencesWindow *window)
        account_store = e_mail_ui_session_get_account_store (
                E_MAIL_UI_SESSION (session));
 
+       /* Ensure the sort order is loaded */
+       if (!e_mail_account_store_load_sort_order (account_store, &error)) {
+               g_warning ("%s: %s", G_STRFUNC, error ? error->message : "Unknown error");
+               g_error_free (error);
+       }
+
        return g_object_new (
                EM_TYPE_ACCOUNT_PREFS,
                "store", account_store,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]