Bug 1557504 - remove [array] use in xpidl from calICalendarSearchProvider.idl and calICalendarViewController.idl. r=pmorris

This commit is contained in:
Khushil Mistry 2019-11-14 08:59:00 +01:00
Родитель aae516e304
Коммит dc870c0d41
9 изменённых файлов: 17 добавлений и 31 удалений

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

@ -558,12 +558,7 @@ agendaListbox.deleteSelectedItem = function(aDoNotConfirm) {
let listItem = this.agendaListboxControl.selectedItem;
if (this.isEventListItem(listItem)) {
let selectedItems = [listItem.occurrence];
calendarViewController.deleteOccurrences(
selectedItems.length,
selectedItems,
false,
aDoNotConfirm
);
calendarViewController.deleteOccurrences(selectedItems, false, aDoNotConfirm);
}
};

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

@ -122,7 +122,7 @@ function copyToClipboard(aCalendarItemArray = null, aCutMode = false) {
if (aCutMode) {
// check for MODIFICATION_PARENT
let useParent = response == 3;
calendarViewController.deleteOccurrences(targetItems.length, targetItems, useParent, true);
calendarViewController.deleteOccurrences(targetItems, useParent, true);
}
}
}

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

@ -514,7 +514,7 @@ function calendarListSetupContextMenu(event) {
}
// Only enable calendar search if there's actually the chance of finding something:
let hasProviders = cal.getCalendarSearchService().getProviders({}).length < 1 && "true";
let hasProviders = cal.getCalendarSearchService().getProviders().length < 1 && "true";
setElementValue("list-calendars-context-find", hasProviders, "collapsed");
}

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

@ -287,7 +287,7 @@ function modifyTaskFromContext(aEvent, initialDate) {
*/
function deleteToDoCommand(aEvent, aDoNotConfirm) {
let tasks = getSelectedTasks(aEvent);
calendarViewController.deleteOccurrences(tasks.length, tasks, false, aDoNotConfirm);
calendarViewController.deleteOccurrences(tasks, false, aDoNotConfirm);
}
/**

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

@ -89,13 +89,7 @@ var calendarViewController = {
* Deletes the given occurrences
* @see calICalendarViewController
*/
deleteOccurrences: function(
count,
occurrencesArg,
useParentItems,
doNotConfirm,
extResponseArg = null
) {
deleteOccurrences: function(occurrencesArg, useParentItems, doNotConfirm, extResponseArg = null) {
startBatchTransaction();
let recurringItems = {};
let extResponse = extResponseArg || { responseMode: Ci.calIItipItem.USER };
@ -544,7 +538,7 @@ function getLastCalendarView() {
*/
function deleteSelectedEvents() {
let selectedItems = currentView().getSelectedItems({});
calendarViewController.deleteOccurrences(selectedItems.length, selectedItems, false, false);
calendarViewController.deleteOccurrences(selectedItems, false, false);
// clear selection
currentView().setSelectedItems(0, [], true);
}

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

@ -50,8 +50,7 @@ interface calICalendarSearchService : calICalendarSearchProvider
/**
* Gets the currently registered set of search providers.
*/
void getProviders(out uint32_t aCount,
[array, size_is(aCount), retval] out calICalendarSearchProvider aProviders);
Array<calICalendarSearchProvider> getProviders();
/**
* Adds a new search provider.

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

@ -63,8 +63,7 @@ interface calICalendarViewController : nsISupports
* @param aDoNotConfirm If set, the events will be deleted without
* confirmation.
*/
void deleteOccurrences (in uint32_t aCount,
[array, size_is(aCount)] in calIItemBase aOccurrences,
void deleteOccurrences (in Array<calIItemBase> aOccurrences,
in boolean aUseParentItems,
in boolean aDoNotConfirm);
};

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

@ -83,8 +83,7 @@ calCalendarSearchService.prototype = {
},
// calICalendarSearchService:
getProviders: function(out_aCount) {
out_aCount.value = this.mProviders.size;
getProviders: function() {
return [...this.mProviders];
},
addProvider: function(aProvider) {

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

@ -14,9 +14,9 @@ function run_test() {
}
function test_found() {
search.getProviders({}).forEach(search.removeProvider, search);
search.getProviders().forEach(search.removeProvider, search);
equal(search.getProviders({}).length, 0);
equal(search.getProviders().length, 0);
let provider1 = {
id: 1,
@ -42,12 +42,12 @@ function test_found() {
provider2.wrappedJSObject = provider2;
search.addProvider(provider1);
equal(search.getProviders({}).length, 1);
equal(search.getProviders().length, 1);
search.addProvider(provider2);
equal(search.getProviders({}).length, 2);
equal(search.getProviders().length, 2);
search.removeProvider(provider1);
equal(search.getProviders({}).length, 1);
equal(search.getProviders({})[0].wrappedJSObject.id, 2);
equal(search.getProviders().length, 1);
equal(search.getProviders()[0].wrappedJSObject.id, 2);
let listener = {
called: false,
@ -66,7 +66,7 @@ function test_found() {
}
function test_failure() {
search.getProviders({}).forEach(search.removeProvider, search);
search.getProviders().forEach(search.removeProvider, search);
let provider = {
searchForCalendars: function(aStr, aHint, aMax, aListener) {
@ -90,7 +90,7 @@ function test_failure() {
}
function test_cancel() {
search.getProviders({}).forEach(search.removeProvider, search);
search.getProviders().forEach(search.removeProvider, search);
let provider = {
QueryInterface: cal.generateQI([Ci.calICalendarSearchProvider, Ci.calIOperation]),