Bug 1436491 - Move category related functions into calCategoryUtils.jsm - automatic changes. r=MakeMyDay

MozReview-Commit-ID: FiYS1ZtzkE7

--HG--
extra : rebase_source : 3e6cadc9a632ff080772ee1e02f46911c45115e1
This commit is contained in:
Philipp Kewisch 2018-02-07 20:57:00 +01:00
Родитель 37c0a6050f
Коммит df27dd0de4
6 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -47,11 +47,11 @@ var gCategoriesPane = {
// If no categories are configured load a default set from properties file
if (!categories) {
categories = cal.setupDefaultCategories();
categories = cal.category.setupDefaultCategories();
document.getElementById("calendar.categories.names").value = categories;
}
gCategoryList = cal.categoriesStringToArray(categories);
gCategoryList = cal.category.stringToArray(categories);
this.updateCategoryList();
@ -78,7 +78,7 @@ var gCategoriesPane = {
updatePrefs: function() {
cal.sortArrayByLocaleCollator(gCategoryList);
document.getElementById("calendar.categories.names").value =
cal.categoriesArrayToString(gCategoryList);
cal.category.arrayToString(gCategoryList);
},
updateCategoryList: function() {

Просмотреть файл

@ -184,7 +184,7 @@
<parameter name="aItem"/>
<body><![CDATA[
let categoryListbox = document.getAnonymousElementByAttribute(this, "anonid", "categories-listbox");
let categoryList = cal.getPrefCategoriesArray();
let categoryList = cal.category.fromPrefs();
cal.sortArrayByLocaleCollator(categoryList);

Просмотреть файл

@ -343,7 +343,7 @@ calOutlookCSVImporter.prototype = {
if ("categoriesIndex" in args) {
txt = this.parseTextField(eventFields[args.categoriesIndex]);
if (txt) {
let categories = cal.categoriesStringToArray(txt);
let categories = cal.category.stringToArray(txt);
event.setCategories(categories.length, categories);
}
}
@ -478,7 +478,7 @@ calOutlookCSVExporter.prototype = {
line.push(alarmDate ? localeEn.valueTrue : localeEn.valueFalse);
line.push(alarmDate ? dateString(alarmDate) : "");
line.push(alarmDate ? timeString(alarmDate) : "");
line.push(txtString(cal.categoriesArrayToString(item.getCategories({})))); // xxx todo: what's the correct way to encode ',' in csv?, how are multi-values expressed?
line.push(txtString(cal.category.arrayToString(item.getCategories({})))); // xxx todo: what's the correct way to encode ',' in csv?, how are multi-values expressed?
line.push(txtString(item.getProperty("DESCRIPTION")));
line.push(txtString(item.getProperty("LOCATION")));
line.push(item.privacy == "PRIVATE" ? localeEn.valueTrue : localeEn.valueFalse);

Просмотреть файл

@ -595,7 +595,7 @@ function loadDialog(aItem) {
// Categories
if (gNewItemUI) {
// XXX more to do here with localization, see loadCategories.
itemProps.initialCategoriesList = cal.sortArrayByLocaleCollator(cal.getPrefCategoriesArray());
itemProps.initialCategoriesList = cal.sortArrayByLocaleCollator(cal.category.fromPrefs());
itemProps.initialCategories = aItem.getCategories({});
// just to demo capsules component

Просмотреть файл

@ -335,7 +335,7 @@ function EventToJSON(aItem, aOfflineStorage, aIsImport) {
// Google does not support categories natively, but allows us to store data
// as an "extendedProperty", so we do here
let categories = cal.categoriesArrayToString(aItem.getCategories({}));
let categories = cal.category.arrayToString(aItem.getCategories({}));
addExtendedProperty("X-MOZ-CATEGORIES", categories);
// Only parse attendees if they are enabled, due to bug 407961
@ -822,7 +822,7 @@ function JSONToEvent(aEntry, aCalendar, aDefaultReminders, aReferenceItem, aMeta
// Google does not support categories natively, but allows us to store
// data as an "extendedProperty", and here it's going to be retrieved
// again
let categories = cal.categoriesStringToArray(sharedProps["X-MOZ-CATEGORIES"]);
let categories = cal.category.stringToArray(sharedProps["X-MOZ-CATEGORIES"]);
item.setCategories(categories.length, categories);
// updated (This must be set last!)

Просмотреть файл

@ -1730,7 +1730,7 @@ calStorageCalendar.prototype = {
// for events DTEND/DUE is enforced by calEvent/calTodo, so suppress DURATION:
break;
case "CATEGORIES": {
let cats = cal.categoriesStringToArray(row.value);
let cats = cal.category.stringToArray(row.value);
item.setCategories(cats.length, cats);
break;
}
@ -2164,7 +2164,7 @@ calStorageCalendar.prototype = {
let cats = item.getCategories({});
if (cats.length > 0) {
ret = CAL_ITEM_FLAG.HAS_PROPERTIES;
this.writeProperty(item, "CATEGORIES", cal.categoriesArrayToString(cats));
this.writeProperty(item, "CATEGORIES", cal.category.arrayToString(cats));
}
return ret;