Closed Bug 953806 Opened 8 years ago Closed 8 years ago

Loading the Themes prefpane is slow


(Instantbird :: Preferences, defect)

Not set


(Not tracked)



(Reporter: florian, Assigned: benediktp)


(Whiteboard: [0.2-nice to have])


(1 file)

*** Original post on bio 363 at 2010-03-09 09:35:00 UTC ***

The code used to initialize the message themes and emoticons tabs requests twice the list of addons from the add-on manager. This operation is slow, the code should probably do it only once for the 2 tabs.
Whiteboard: [0.2-nice to have]
*** Original post on bio 363 as attmnt 282 at 2010-03-12 18:45:00 UTC ***

I moved the code loading the extension list to the general javascript file for this theme (maybe move it to an even more general place if it is necessary elsewhere?).

messagestle.js and smileys.js are requesting it from there now, getting a cached copy of the list.
Attachment #8352023 - Flags: review?(florian)
Assignee: nobody → benediktp
Comment on attachment 8352023 [details] [diff] [review]
Gets extension list once in theme.js, caches for later use

*** Original change on bio 363 attmnt 282 at 2010-03-19 17:08:30 UTC ***

I would have probably fetched the list in the init method in themes.js, and added a parameter in each of the buildThemeList functions. This would have saved keeping the list loaded in memory until the preference window is closed.

It's a very minor detail, and your approach is good to. This bug isn't worth discussing details forever, so I'll just take your patch :).

A few coding style nits:
 - space before and after the test in the if statement: if (test) {
 - space before { in function() {
 - I also fixed the indentation of the .getService and .getItemList lines (and wrapped after the = in the first line of the assignment, so as to reduce the length of the following lines which were well over 80 columns).
Attachment #8352023 - Flags: review?(florian) → review+
*** Original post on bio 363 at 2010-03-19 17:42:53 UTC ***
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.2
You need to log in before you can comment on or make changes to this bug.