зеркало из https://github.com/mozilla/gecko-dev.git
Bug 426806 - "Sort by Name" is slow in Places. r=dietrich.
This commit is contained in:
Родитель
ce90fb3c24
Коммит
49dd1a22db
|
@ -897,14 +897,25 @@ 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(aUserData) {
|
||||
for (var i = 0; i < newOrder.length; ++i) {
|
||||
PlacesUtils.bookmarks.setItemIndex(newOrder[i].itemId, i);
|
||||
}
|
||||
}
|
||||
};
|
||||
PlacesUtils.bookmarks.runInBatchMode(callback, newOrder);
|
||||
},
|
||||
|
||||
undoTransaction: function PSSFBN_undoTransaction() {
|
||||
for (item in this._oldOrder)
|
||||
PlacesUtils.bookmarks.setItemIndex(item, this._oldOrder[item]);
|
||||
var callback = {
|
||||
runBatched: function(aUserData) {
|
||||
for (item in oldOrder)
|
||||
PlacesUtils.bookmarks.setItemIndex(item, oldOrder[item]);
|
||||
}
|
||||
};
|
||||
PlacesUtils.bookmarks.runInBatchMode(callback, this._oldOrder);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче