Skip to content
Snippets Groups Projects
Commit 2d0b3290 authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

SH-4238 WIP - postpone calling notifyObservers until all deletes are processed.

parent 56cf4297
No related branches found
No related tags found
No related merge requests found
...@@ -476,7 +476,9 @@ void AISUpdate::doUpdate() ...@@ -476,7 +476,9 @@ void AISUpdate::doUpdate()
del_it != mObjectsDeleted.end(); ++del_it) del_it != mObjectsDeleted.end(); ++del_it)
{ {
LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl; LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl;
gInventory.onObjectDeletedFromServer(*del_it, false, false); gInventory.onObjectDeletedFromServer(*del_it, false, false, false);
} }
gInventory.notifyObservers();
} }
...@@ -1157,6 +1157,7 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat, ...@@ -1157,6 +1157,7 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat,
void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update) void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update)
{ {
LLTimer timer;
if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
{ {
dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update); dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update);
...@@ -1164,6 +1165,7 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS ...@@ -1164,6 +1165,7 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS
AISUpdate ais_update(update); // parse update llsd into stuff to do. AISUpdate ais_update(update); // parse update llsd into stuff to do.
ais_update.doUpdate(); // execute the updates in the appropriate order. ais_update.doUpdate(); // execute the updates in the appropriate order.
llinfos << "elapsed: " << timer.getElapsedTimeF32() << llendl;
} }
void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version) void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version)
...@@ -1316,7 +1318,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo ...@@ -1316,7 +1318,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo
// Update model after an item is confirmed as removed from // Update model after an item is confirmed as removed from
// server. Works for categories or items. // server. Works for categories or items.
void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links, bool update_parent_version) void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links, bool update_parent_version, bool do_notify_observers)
{ {
LLPointer<LLInventoryObject> obj = getObject(object_id); LLPointer<LLInventoryObject> obj = getObject(object_id);
if(obj) if(obj)
...@@ -1337,13 +1339,13 @@ void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool f ...@@ -1337,13 +1339,13 @@ void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool f
// From purgeObject() // From purgeObject()
LLPreview::hide(object_id); LLPreview::hide(object_id);
deleteObject(object_id, fix_broken_links); deleteObject(object_id, fix_broken_links, do_notify_observers);
} }
} }
// Delete a particular inventory object by ID. // Delete a particular inventory object by ID.
void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links) void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, bool do_notify_observers)
{ {
lldebugs << "LLInventoryModel::deleteObject()" << llendl; lldebugs << "LLInventoryModel::deleteObject()" << llendl;
LLPointer<LLInventoryObject> obj = getObject(id); LLPointer<LLInventoryObject> obj = getObject(id);
...@@ -1402,7 +1404,10 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links) ...@@ -1402,7 +1404,10 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links)
{ {
updateLinkedObjectsFromPurge(id); updateLinkedObjectsFromPurge(id);
} }
notifyObservers(); if (do_notify_observers)
{
notifyObservers();
}
} }
void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id) void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id)
......
...@@ -334,7 +334,10 @@ class LLInventoryModel ...@@ -334,7 +334,10 @@ class LLInventoryModel
// Update model after an item is confirmed as removed from // Update model after an item is confirmed as removed from
// server. Works for categories or items. // server. Works for categories or items.
void onObjectDeletedFromServer(const LLUUID& item_id, bool fix_broken_links = true, bool update_parent_version = true); void onObjectDeletedFromServer(const LLUUID& item_id,
bool fix_broken_links = true,
bool update_parent_version = true,
bool do_notify_observers = true);
// Update model after all descendents removed from server. // Update model after all descendents removed from server.
void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true); void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true);
...@@ -349,7 +352,7 @@ class LLInventoryModel ...@@ -349,7 +352,7 @@ class LLInventoryModel
// object from the internal data structures, maintaining a // object from the internal data structures, maintaining a
// consistent internal state. No cache accounting, observer // consistent internal state. No cache accounting, observer
// notification, or server update is performed. // notification, or server update is performed.
void deleteObject(const LLUUID& id, bool fix_broken_links = true); void deleteObject(const LLUUID& id, bool fix_broken_links = true, bool do_notify_observers = true);
/// move Item item_id to Trash /// move Item item_id to Trash
void removeItem(const LLUUID& item_id); void removeItem(const LLUUID& item_id);
/// move Category category_id to Trash /// move Category category_id to Trash
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment