Closed Bug 714595 Opened 8 years ago Closed 8 years ago

Simplify FillIdentityList() and getCurrentIdentity().

Categories

(SeaMonkey :: MailNews: Composition, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: philip.chee, Assigned: philip.chee)

References

Details

Attachments

(2 files)

>> function compareAccountSortOrder(account1, account2)
>> {
>>+  var ds = Components.classes["@mozilla.org/rdf/datasource;1?name=msgaccountmanager"]
>>+                     .getService(Components.interfaces.nsIRDFDataSource);
> How expensive is it to move this into the sort function? I guess most people do not have that many accounts but worth checking.

I'll fix this by porting more of jminta's thunderbird patch.
Summary: Simplify FillIdentityList() → Bug 714595 Simplify FillIdentityList() and getCurrentIdentity().
> -  var ds = Components.classes["@mozilla.org/rdf/datasource;1?name=msgaccountmanager"]
> -                     .getService(Components.interfaces.nsIRDFDataSource);
This should help with the de-RDF effort.

> +  accounts = accounts.filter(function isNonSuckyAccount(a) {return !!a.incomingServer;});
isNonSuckyAccount() is what Thunderbird uses!

> -    // fill in Identity combobox
Drive by fix. Magnus did this for Thunderbird recently.
Assignee: nobody → philip.chee
Status: NEW → ASSIGNED
Attachment #585266 - Flags: review?(iann_bugzilla)
Summary: Bug 714595 Simplify FillIdentityList() and getCurrentIdentity(). → Simplify FillIdentityList() and getCurrentIdentity().
Attachment #585266 - Flags: review?(iann_bugzilla) → review+
Attachment #585266 - Flags: superreview?(mnyromyr)
Comment on attachment 585266 [details] [diff] [review]
Patch v1.0 Proposed Fix.

>+  // Ugly hack to work around bug 41133. :-(
>+  accounts = accounts.filter(function isNonSuckyAccount(a) {return !!a.incomingServer;});

Inner functions should adhere to the Mozilla/SM MailNews style guide as well, e.g. IsNonSuckyAccount(aAccount) here.

>+  function sortAccounts(a, b)

Same here.

moa=me with that.
Attachment #585266 - Flags: superreview?(mnyromyr) → superreview+
Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/edae64607f3d

> Inner functions should adhere to the Mozilla/SM MailNews style guide as well,
> e.g. IsNonSuckyAccount(aAccount) here.
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.