Bug 405502 - Imported task is displayed twice in task list, r=dbo

This commit is contained in:
michael.buettner%sun.com 2007-12-11 11:21:28 +00:00
Родитель 3fedb3dee2
Коммит 8b792e0505
1 изменённых файлов: 13 добавлений и 8 удалений

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

@ -185,12 +185,15 @@
addItem: function tTV_addItem(aItem) { addItem: function tTV_addItem(aItem) {
// The rowCountChanged function takes two arguments, the index where the // The rowCountChanged function takes two arguments, the index where the
// first row was inserted and the number of rows to insert. // first row was inserted and the number of rows to insert.
this.binding.mTaskArray.push(aItem); var index = this.binding.mHash2Index[aItem.hashId];
var index = this.binding.mTaskArray.length - 1; if (index === undefined) {
this.binding.mHash2Index[aItem.hashId] = index; var index = this.binding.mTaskArray.length;
this.treebox.rowCountChanged(index, 1); this.binding.mTaskArray.push(aItem);
this.tree.view.selection.select(index); this.binding.mHash2Index[aItem.hashId] = index;
this.treebox.rowCountChanged(index, 1);
this.tree.view.selection.select(index);
}
}, },
removeItem: function tTV_removeItem(aItem) { removeItem: function tTV_removeItem(aItem) {
@ -558,8 +561,10 @@
}, },
onEndBatch: function tTO_onEndBatch() { onEndBatch: function tTO_onEndBatch() {
this.mInBatch = false; if (this.mInBatch) {
this.binding.refresh(); this.mInBatch = false;
this.binding.refresh();
}
}, },
onLoad: function tTO_onLoad() { onLoad: function tTO_onLoad() {