зеркало из https://github.com/mozilla/gecko-dev.git
Bug 426806 - 'Sort By Name' is slow. r=dietrich.
This commit is contained in:
Родитель
43b7526969
Коммит
9ca892e70f
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче