summaryrefslogtreecommitdiff
path: root/indra/newview/llfavoritesbar.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2010-01-15 13:27:25 -0800
committerCallum Prentice <callum@lindenlab.com>2010-01-15 13:27:25 -0800
commit7590704e0e93b48f897c47dba07916efebd95274 (patch)
treee38f863dc5a72bc078d362a9fee214e018d0ca05 /indra/newview/llfavoritesbar.cpp
parent940e070326e920b6314c7153f687d9985ad763ed (diff)
parent7efc0fbb4fd912d59a38a4d5653f1dc12c3876b1 (diff)
Merge with Tip
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);