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; let listItem = this.agendaListboxControl.selectedItem;
if (this.isEventListItem(listItem)) { if (this.isEventListItem(listItem)) {
let selectedItems = [listItem.occurrence]; let selectedItems = [listItem.occurrence];
calendarViewController.deleteOccurrences( calendarViewController.deleteOccurrences(selectedItems, false, aDoNotConfirm);
selectedItems.length,
selectedItems,
false,
aDoNotConfirm
);
} }
}; };

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

@ -122,7 +122,7 @@ function copyToClipboard(aCalendarItemArray = null, aCutMode = false) {
if (aCutMode) { if (aCutMode) {
// check for MODIFICATION_PARENT // check for MODIFICATION_PARENT
let useParent = response == 3; 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: // 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"); setElementValue("list-calendars-context-find", hasProviders, "collapsed");
} }

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

@ -287,7 +287,7 @@ function modifyTaskFromContext(aEvent, initialDate) {
*/ */
function deleteToDoCommand(aEvent, aDoNotConfirm) { function deleteToDoCommand(aEvent, aDoNotConfirm) {
let tasks = getSelectedTasks(aEvent); 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 * Deletes the given occurrences
* @see calICalendarViewController * @see calICalendarViewController
*/ */
deleteOccurrences: function( deleteOccurrences: function(occurrencesArg, useParentItems, doNotConfirm, extResponseArg = null) {
count,
occurrencesArg,
useParentItems,
doNotConfirm,
extResponseArg = null
) {
startBatchTransaction(); startBatchTransaction();
let recurringItems = {}; let recurringItems = {};
let extResponse = extResponseArg || { responseMode: Ci.calIItipItem.USER }; let extResponse = extResponseArg || { responseMode: Ci.calIItipItem.USER };
@ -544,7 +538,7 @@ function getLastCalendarView() {
*/ */
function deleteSelectedEvents() { function deleteSelectedEvents() {
let selectedItems = currentView().getSelectedItems({}); let selectedItems = currentView().getSelectedItems({});
calendarViewController.deleteOccurrences(selectedItems.length, selectedItems, false, false); calendarViewController.deleteOccurrences(selectedItems, false, false);
// clear selection // clear selection
currentView().setSelectedItems(0, [], true); currentView().setSelectedItems(0, [], true);
} }

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

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

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

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

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

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

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

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