diff options
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llinventorymodel.h | 12 |
2 files changed, 20 insertions, 19 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 8583cca103..ad6d960b8c 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1740,12 +1740,10 @@ void LLInventoryModel::changeItemParent(LLViewerInventoryItem* item, << " from " << make_inventory_info(item->getParentUUID()) << " to " << make_inventory_info(new_parent_id) << LL_ENDL; - LLInventoryModel::update_list_t update; - LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1); - update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); - update.push_back(new_folder); - accountForUpdate(update); + LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(), -1); + accountForUpdate(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1, false); + accountForUpdate(new_folder); LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); new_item->setParent(new_parent_id); @@ -1775,12 +1773,10 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat, << " from " << make_inventory_info(cat->getParentUUID()) << " to " << make_inventory_info(new_parent_id) << LL_ENDL; - LLInventoryModel::update_list_t update; LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1); - update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); - update.push_back(new_folder); - accountForUpdate(update); + accountForUpdate(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1, false); + accountForUpdate(new_folder); LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat); new_cat->setParent(new_parent_id); @@ -2538,7 +2534,10 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const { descendents_actual += update.mDescendentDelta; cat->setDescendentCount(descendents_actual); - cat->setVersion(++version); + if (update.mChangeVersion) + { + cat->setVersion(++version); + } LL_DEBUGS(LOG_INV) << "accounted: '" << cat->getName() << "' " << version << " with " << descendents_actual << " descendents." << LL_ENDL; @@ -2566,7 +2565,7 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const } void LLInventoryModel::accountForUpdate( - const LLInventoryModel::update_list_t& update) + const LLInventoryModel::update_list_t& update) const { update_list_t::const_iterator it = update.begin(); update_list_t::const_iterator end = update.end(); @@ -2577,7 +2576,7 @@ void LLInventoryModel::accountForUpdate( } void LLInventoryModel::accountForUpdate( - const LLInventoryModel::update_map_t& update) + const LLInventoryModel::update_map_t& update) const { LLCategoryUpdate up; update_map_t::const_iterator it = update.begin(); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 69d987cabd..41faafa6bb 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -511,12 +511,14 @@ public: // Represents the number of items added or removed from a category. struct LLCategoryUpdate { - LLCategoryUpdate() : mDescendentDelta(0) {} - LLCategoryUpdate(const LLUUID& category_id, S32 delta) : + LLCategoryUpdate() : mDescendentDelta(0), mChangeVersion(true) {} + LLCategoryUpdate(const LLUUID& category_id, S32 delta, bool change_version = true) : mCategoryID(category_id), - mDescendentDelta(delta) {} + mDescendentDelta(delta), + mChangeVersion(change_version) {} LLUUID mCategoryID; S32 mDescendentDelta; + bool mChangeVersion; }; typedef std::vector<LLCategoryUpdate> update_list_t; @@ -534,8 +536,8 @@ public: // Call when there are category updates. Call them *before* the // actual update so the method can do descendent accounting correctly. void accountForUpdate(const LLCategoryUpdate& update) const; - void accountForUpdate(const update_list_t& updates); - void accountForUpdate(const update_map_t& updates); + void accountForUpdate(const update_list_t& updates) const; + void accountForUpdate(const update_map_t& updates) const; // Return (yes/no/maybe) child status of category children. EHasChildren categoryHasChildren(const LLUUID& cat_id) const; |