Bug 1608610 - Remove code for the calendar-timezones addon. r=darktrojan
authorPaul Morris <paul@thunderbird.net>
Tue, 28 Jan 2020 22:05:30 -0500
changeset 37221 617509326044bf9249768bc37019380adfae0135
parent 37220 5802fba79ad0b257cfd434ba644adb65f8dcc370
child 37222 50ae36bb50fdd97b9f8efd795f5c5be12130abd0
push id2552
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:24:16 +0000
treeherdercomm-beta@f95a6f4408a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1608610
Bug 1608610 - Remove code for the calendar-timezones addon. r=darktrojan
calendar/base/src/calCalendarManager.js
calendar/base/src/calTimezoneService.js
calendar/locales/en-US/chrome/calendar/calendar.properties
--- a/calendar/base/src/calCalendarManager.js
+++ b/calendar/base/src/calCalendarManager.js
@@ -231,19 +231,16 @@ calCalendarManager.prototype = {
         rc = ex.result;
         uiMessage = ex.message;
       }
       switch (rc) {
         case Ci.calIErrors.STORAGE_UNKNOWN_SCHEMA_ERROR:
           // For now we alert and quit on schema errors like we've done before:
           this.alertAndQuit();
           return null;
-        case Ci.calIErrors.STORAGE_UNKNOWN_TIMEZONES_ERROR:
-          uiMessage = cal.l10n.getCalString("unknownTimezonesError", [uri.spec]);
-          break;
         default:
           uiMessage = cal.l10n.getCalString("unableToCreateProvider", [uri.spec]);
           break;
       }
       // Log the original exception via error console to provide more debug info
       cal.ERROR(ex);
 
       // Log the possibly translated message via the UI.
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -98,26 +98,17 @@ calTimezoneService.prototype = {
             resolve(tzData);
           } catch (ex) {
             reject(ex);
           }
         });
       });
     }
 
-    let resNamespace = "calendar";
-    // Check for presence of the calendar timezones add-on.
-    let resProtocol = Services.io
-      .getProtocolHandler("resource")
-      .QueryInterface(Ci.nsIResProtocolHandler);
-    if (resProtocol.hasSubstitution("calendar-timezones")) {
-      resNamespace = "calendar-timezones";
-    }
-
-    fetchJSON("resource://" + resNamespace + "/timezones/zones.json")
+    fetchJSON("resource://calendar/timezones/zones.json")
       .then(tzData => {
         for (let tzid of Object.keys(tzData.aliases)) {
           let data = tzData.aliases[tzid];
           if (typeof data == "object" && data !== null) {
             this.mZones.set(tzid, data);
           }
         }
         for (let tzid of Object.keys(tzData.zones)) {
@@ -125,34 +116,31 @@ calTimezoneService.prototype = {
           if (typeof data == "object" && data !== null) {
             this.mZones.set(tzid, data);
           }
         }
 
         this.mVersion = tzData.version;
         cal.LOG("[calTimezoneService] Timezones version " + this.version + " loaded");
 
-        let bundleURL = "chrome://" + resNamespace + "/locale/timezones.properties";
+        let bundleURL = "chrome://calendar/locale/timezones.properties";
         this.stringBundle = ICAL.Timezone.cal_tz_bundle = Services.strings.createBundle(bundleURL);
 
         // Make sure UTC and floating are cached by calling their getters
         this.UTC; // eslint-disable-line no-unused-expressions
         this.floating; // eslint-disable-line no-unused-expressions
       })
       .then(
         () => {
           if (aCompleteListener) {
             aCompleteListener.onResult(null, Cr.NS_OK);
           }
         },
         error => {
-          // We have to give up. Show an error and fail hard!
-          let msg = cal.l10n.getCalString("missingCalendarTimezonesError");
-          cal.ERROR(msg);
-          cal.showError(msg);
+          cal.ERROR("Missing calendar timezones error.");
         }
       );
   },
 
   shutdown: function(aCompleteListener) {
     Services.prefs.removeObserver("calendar.timezone.local", this);
     aCompleteListener.onResult(null, Cr.NS_OK);
   },
--- a/calendar/locales/en-US/chrome/calendar/calendar.properties
+++ b/calendar/locales/en-US/chrome/calendar/calendar.properties
@@ -123,18 +123,16 @@ HTMLTitle=Mozilla Calendar
 timezoneError=An unknown and undefined timezone was found while reading %1$S.
 
 # LOCALIZATION NOTE (duplicateError):
 #    %1$S will be replaced with number of duplicate items
 #    %2$S will be replaced with a file path pointing to a calendar
 duplicateError=%1$S item(s) were ignored since they exist in both the destination calendar and %2$S.
 
 unableToCreateProvider=An error was encountered preparing the calendar located at %1$S for use. It will not be available.
-unknownTimezonesError=An error was encountered preparing the calendar located at %1$S for use. The calendar might refer to unknown timezones. Please install the latest calendar-timezones.xpi.
-missingCalendarTimezonesError=No timezones found! Please install calendar-timezones.xpi.
 
 # Sample: Unknown timezone "USPacific" in "Dentist Appt".  Using the 'floating' local timezone instead: 2008/02/28 14:00:00
 unknownTimezoneInItem=Unknown timezone "%1$S" in "%2$S".  Treated as 'floating' local timezone instead: %3$S
 TimezoneErrorsAlertTitle=Timezone Errors
 TimezoneErrorsSeeConsole=See Error Console: Unknown timezones are treated as the 'floating' local timezone.
 
 # The following strings are for the prompt to delete/unsubscribe from the calendar
 removeCalendarTitle=Remove Calendar