diff --git a/calendar/resources/content/calendarManagement.js b/calendar/resources/content/calendarManagement.js index 487d5fb589d..92de5c383bd 100644 --- a/calendar/resources/content/calendarManagement.js +++ b/calendar/resources/content/calendarManagement.js @@ -168,6 +168,7 @@ function setCalendarManagerUI() calendarList.removeChild(child); } + var composite = getDisplayComposite(); var calmgr = getCalendarManager(); var calendars = calmgr.getCalendars({}); for each (var calendar in calendars) { @@ -175,7 +176,9 @@ function setCalendarManagerUI() var checkCell = document.createElement("listcell"); checkCell.setAttribute("type", "checkbox"); - checkCell.setAttribute("checked", true); + + checkCell.setAttribute("checked", + composite.getCalendar(calendar.uri) ? true : false); listItem.appendChild(checkCell); listItem.addEventListener("click", onCalendarCheckboxClick, true); diff --git a/calendar/resources/content/calendarUtils.js b/calendar/resources/content/calendarUtils.js index bb7c891ef1f..a517751d3cd 100644 --- a/calendar/resources/content/calendarUtils.js +++ b/calendar/resources/content/calendarUtils.js @@ -53,11 +53,7 @@ function getDisplayComposite() if (!gDisplayComposite) { gDisplayComposite = Components.classes["@mozilla.org/calendar/calendar;1?type=composite"] .createInstance(Components.interfaces.calICompositeCalendar); - var calMgr = getCalendarManager(); - var calList = calMgr.getCalendars({}); - for (i in calList) { - gDisplayComposite.addCalendar(calList[i]); - } + gDisplayComposite.prefPrefix = 'calendar-main'; } return gDisplayComposite; }