Bug 347113 Unsubscribing from a calendar causes a js error. patch by Lukas Ramach <ramach@utanet.at>, r=jminta
git-svn-id: svn://10.0.0.236/trunk@206841 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
38f89ece68
commit
a90c9c4ff2
@ -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]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user