зеркало из https://github.com/mozilla/pjs.git
Bug 347113 Unsubscribing from a calendar causes a js error. patch by Lukas Ramach <ramach@utanet.at>, r=jminta
This commit is contained in:
Родитель
e305ad4abb
Коммит
09a4a58d97
|
@ -224,15 +224,19 @@ calCompositeCalendar.prototype = {
|
|||
},
|
||||
|
||||
setDefaultCalendar: function (cal, usePref) {
|
||||
if (this.mDefaultCalendar && this.mDefaultCalendar.uri.equals(cal.uri))
|
||||
// don't do anything if the passed calendar is the default calendar!
|
||||
if (this.mDefaultCalendar && cal && this.mDefaultCalendar.uri.equals(cal.uri))
|
||||
return;
|
||||
if (usePref && this.mPrefPrefix) {
|
||||
if (this.mDefaultCalendar) {
|
||||
getCalendarManager().deleteCalendarPref(this.mDefaultCalendar,
|
||||
this.mDefaultPref);
|
||||
}
|
||||
getCalendarManager().setCalendarPref(cal, this.mDefaultPref,
|
||||
"true");
|
||||
// if not null set the new calendar as default in the preferences
|
||||
if (cal) {
|
||||
getCalendarManager().setCalendarPref(cal, this.mDefaultPref,
|
||||
"true");
|
||||
}
|
||||
}
|
||||
this.mDefaultCalendar = cal;
|
||||
this.notifyObservers("onDefaultCalendarChanged", [cal]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче