summaryrefslogtreecommitdiff
path: root/indra/newview/llfavoritesbar.cpp
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-01-15 18:02:42 +0200
committerMike Antipov <mantipov@productengine.com>2010-01-15 18:02:42 +0200
commit6e67ac5e02e0e22433f679eff29a5426d3ace1be (patch)
tree6c39ddbe183e5ca7fb64837404212378798b98fa /indra/newview/llfavoritesbar.cpp
parent7aa96279fe1a5391e1e276961bd9fb7cb81cf3a1 (diff)
Fixed low bug EXT-4311 (Order of items in 'Favorites Bar' folder remains non-changed if change its order in the 'Favorites Bar')
-- reason: there was two places where identical resorting of Favorite landmarks functionality was implemented: InventoryBridge & Favorite bar. It was not impelnmented properly in favorites bar: LLInventoryObserver::SORT flag was not set after d-n-d. -- fix: moved identical functionality to update & save order of Favorite landmarks from these places to Inventory Panel --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llfavoritesbar.cpp')
-rw-r--r--indra/newview/llfavoritesbar.cpp32
1 files changed, 2 insertions, 30 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 4103ccf175..fd6a92c47a 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -508,14 +508,14 @@ void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y)
if (dest)
{
- updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId());
+ LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId());
}
else
{
mItems.push_back(gInventory.getItem(mDragItemId));
}
- saveItemsOrder(mItems);
+ gInventory.saveItemsOrder(mItems);
LLToggleableMenu* menu = (LLToggleableMenu*) mPopupMenuHandle.get();
@@ -1193,25 +1193,6 @@ BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array
return result;
}
-void LLFavoritesBarCtrl::saveItemsOrder(LLInventoryModel::item_array_t& items)
-{
- int sortField = 0;
-
- // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field
- for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i)
- {
- LLViewerInventoryItem* item = *i;
-
- item->setSortField(++sortField);
- item->setComplete(TRUE);
- item->updateServer(FALSE);
-
- gInventory.updateItem(item);
- }
-
- gInventory.notifyObservers();
-}
-
LLInventoryModel::item_array_t::iterator LLFavoritesBarCtrl::findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id)
{
LLInventoryModel::item_array_t::iterator result = items.end();
@@ -1228,15 +1209,6 @@ LLInventoryModel::item_array_t::iterator LLFavoritesBarCtrl::findItemByUUID(LLIn
return result;
}
-void LLFavoritesBarCtrl::updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& srcItemId, const LLUUID& destItemId)
-{
- LLViewerInventoryItem* srcItem = gInventory.getItem(srcItemId);
- LLViewerInventoryItem* destItem = gInventory.getItem(destItemId);
-
- items.erase(findItemByUUID(items, srcItem->getUUID()));
- items.insert(findItemByUUID(items, destItem->getUUID()), srcItem);
-}
-
void LLFavoritesBarCtrl::insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, LLViewerInventoryItem* insertedItem)
{
LLViewerInventoryItem* beforeItem = gInventory.getItem(beforeItemId);