Changes in / [767529:1e1bc6]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/vI_account.js

    r767529 r1e1bc6  
    214214        Log.debug("checking for leftover VirtualIdentity accounts ...")
    215215        var accounts = getAccountsArray();
    216 //         Log.debug("number of currently used accounts = " + accounts.length);
    217216
    218217        for (let acc = 0; acc < accounts.length; acc++) {
     
    223222            // replace account with key, required for next check
    224223            accounts[acc] = accounts[acc].key;
    225 //             Log.debug("current account = " + accounts[acc]);
    226         }
    227        
    228 //         var usedAccounts = prefroot.getCharPref("mail.accountmanager.accounts");
    229         var lastAccountKey = prefroot.getIntPref("mail.account.lastKey");
    230 //         Log.debug("number of last AccountKey = " + lastAccountKey);
    231         for (let key = 0; key <= lastAccountKey; key++) {
    232             if (accounts.indexOf("account" + key) > -1) continue;
    233             account.__removeAccountPrefs("account" + key);
    234         }
     224        }
     225
     226        //      account-prefs are not removed, grrrr --> https://bugzilla.mozilla.org/show_bug.cgi?id=875675
     227        try {
     228            var lastAccountKey = prefroot.getIntPref("mail.account.lastKey");
     229            for (let key = 0; key <= lastAccountKey; key++) {
     230                if (accounts.indexOf("account" + key) > -1) continue;
     231                account.__removeAccountPrefs("account" + key);
     232            }
     233        }
     234        catch (e) {};
    235235        Log.debug("done.")
    236236        account.__cleanupDirectories();
     
    287287
    288288        // prevent useless increasing of lastKey https://bugzilla.mozilla.org/show_bug.cgi?id=485839
    289         var lastAccountKey = prefroot.getIntPref("mail.account.lastKey");
    290         if ("account" + lastAccountKey == key)
    291             prefroot.setIntPref("mail.account.lastKey", lastAccountKey - 1);
     289        try {
     290            var lastAccountKey = prefroot.getIntPref("mail.account.lastKey");
     291            if ("account" + lastAccountKey == key)
     292                prefroot.setIntPref("mail.account.lastKey", lastAccountKey - 1);
     293        }
     294        catch (e) { };
    292295
    293296        account.__removeAccountPrefs(key);
Note: See TracChangeset for help on using the changeset viewer.