Bug 416468 - "Sort by Name" doesn't work for folders directly located under "All Bookmarks" within the Library. r=dietrich.

This commit is contained in:
mozilla.mano@sent.com 2008-02-10 14:51:57 -08:00
Родитель 59c66c8b3d
Коммит d2be33cd80
4 изменённых файлов: 8 добавлений и 13 удалений

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

@ -848,9 +848,8 @@ PlacesController.prototype = {
* Sort the selected folder by name
*/
sortFolderByName: function PC_sortFolderByName() {
var selectedNode = this._view.selectedNode;
var txn = PlacesUtils.ptm.sortFolderByName(selectedNode.itemId,
selectedNode.bookmarkIndex);
var itemId = PlacesUtils.getConcreteItemId(this._view.selectedNode);
var txn = PlacesUtils.ptm.sortFolderByName(itemId);
PlacesUtils.ptm.doTransaction(txn);
},

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

@ -52,7 +52,7 @@ interface nsITransaction;
* the global scope of a js window.
*/
[scriptable, uuid(d91e4575-14cf-497d-b497-bd47b40c50e3)]
[scriptable, uuid(7179d28c-bc41-4110-8225-b3ba7e1cb293)]
interface nsIPlacesTransactionsService : nsITransactionManager
{
/**
@ -315,12 +315,9 @@ interface nsIPlacesTransactionsService : nsITransactionManager
*
* @param aFolderId
* id of the folder to sort
* @oaram aFolderIndex
* index of the folder to sort
* @returns nsITransaction object
*/
nsITransaction sortFolderByName(in long long aFolderId,
in long long aFolderIndex);
nsITransaction sortFolderByName(in long long aFolderId);
/**
* Transaction for tagging a URL with the given set of tags. Current tags set

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

@ -157,8 +157,8 @@ placesTransactionsService.prototype = {
return new placesEditItemLastModifiedTransaction(aID, aNewLastModified);
},
sortFolderByName: function placesSortFldrByName(aFolderId, aFolderIndex) {
return new placesSortFolderByNameTransactions(aFolderId, aFolderIndex);
sortFolderByName: function placesSortFldrByName(aFolderId) {
return new placesSortFolderByNameTransactions(aFolderId);
},
tagURI: function placesTagURI(aURI, aTags) {
@ -818,9 +818,8 @@ placesEditItemLastModifiedTransaction.prototype = {
}
};
function placesSortFolderByNameTransactions(aFolderId, aFolderIndex) {
function placesSortFolderByNameTransactions(aFolderId) {
this._folderId = aFolderId;
this._folderIndex = aFolderIndex;
this._oldOrder = null,
this.redoTransaction = this.doTransaction;
}

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

@ -363,7 +363,7 @@ function run_test() {
do_check_eq(0, bmsvc.getItemIndex(b1));
do_check_eq(1, bmsvc.getItemIndex(b2));
do_check_eq(2, bmsvc.getItemIndex(b3));
var txn17 = ptSvc.sortFolderByName(srtFldId, 1);
var txn17 = ptSvc.sortFolderByName(srtFldId);
txn17.doTransaction();
do_check_eq(2, bmsvc.getItemIndex(b1));
do_check_eq(1, bmsvc.getItemIndex(b2));