Bug 426806 - 'Sort By Name' is slow. r=dietrich.

This commit is contained in:
Asaf Romano 2008-07-24 00:15:48 +03:00
parent 43b7526969
commit 9ca892e70f

View File

@ -897,14 +897,26 @@ placesSortFolderByNameTransactions.prototype = {
newOrder = newOrder.concat(preSep);
}
// set the nex indexs
for (var i = 0; i < count; ++i)
PlacesUtils.bookmarks.setItemIndex(newOrder[i].itemId, i);
// set the nex indexes
var callback = {
runBatched: function() {
for (var i = 0; i < newOrder.length; ++i) {
PlacesUtils.bookmarks.setItemIndex(newOrder[i].itemId, i);
}
}
};
PlacesUtils.bookmarks.runInBatchMode(callback, null);
},
undoTransaction: function PSSFBN_undoTransaction() {
for (item in this._oldOrder)
PlacesUtils.bookmarks.setItemIndex(item, this._oldOrder[item]);
var callback = {
_self: this,
runBatched: function() {
for (item in this._self._oldOrder)
PlacesUtils.bookmarks.setItemIndex(item, this._self._oldOrder[item]);
}
};
PlacesUtils.bookmarks.runInBatchMode(callback, null);
}
};