function putItemsIntoCal(destCal, aItems) { 
function putItemsIntoCal(destCal, aItems, aFilePath) { 
function putItemsIntoCal(destCal, aItems) {    // Set batch for the undo/redo transaction manager    startBatchTransaction();    // And set batch mode on the calendar, to tell the views to not    // redraw until all items are imported    destCal.startBatch();    // This listener is needed to find out when the last addItem really    // finished. Using a counter to find the last item (which might not    // be the last item added)    var count = 0;    var failedCount = 0;    // Used to store the last error. Only the last error, because we don't    // wan't to bomb the user with thousands of error messages in case    // something went really wrong.    // (example of something very wrong: importing the same file twice.    //  quite easy to trigger, so we really should do this)    var lastError;    var listener = {        onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {            count++;            if (!Components.isSuccessCode(aStatus)) {                failedCount++;                lastError = aStatus;            }            // See if it is time to end the calendar's batch.            if (count == aItems.length) {                destCal.endBatch();                if (failedCount) {                    var msg = calGetString("calendar", "importItemsFailed",                                           [failedCount, lastError.toString()]);                    showError(msg);                }            }        }    }    for each (item in aItems) {        // XXX prompt when finding a duplicate.        try {            destCal.addItem(item, listener);        } catch(e) {            failedCount++;            lastError = e;            // Call the listener's operationComplete, to increase the            // counter and not miss failed items. Otherwise, endBatch might            // never be called.            listener.onOperationComplete(null, null, null, null, null);            Components.utils.reportError("Import error: "+e);        }    }    // End transmgr batch    endBatchTransaction();}
5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5872/9a4a610f46e352dc9f61d73f19ec14fa438d1452/import-export.js/clean/calendar/base/content/import-export.js