From 999b9e28ce511b9a0753ebd87ce32cc524ef42ee Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 12 Nov 2009 20:36:54 -0500 Subject: EXT-2349 : Diagnose warning spam: "[X] is in model and in view, but STRUCTURE flag not set" EXT-2432 : Diagnose warning spam: "[X] does not exist in either view or model, but notification triggered" Restructured llinventorypanel's handling of add/remove/structure so it's easier to understand Removed false positive "notification triggered" warning since objects can now exist outside of various inventory panels' directories. --HG-- branch : avatar-pipeline --- indra/newview/llinventorymodel.cpp | 6 +- indra/newview/llinventorypanel.cpp | 115 +++++++++++++++++++------------------ 2 files changed, 63 insertions(+), 58 deletions(-) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 4b0d524906..ed5b7df5fa 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -886,7 +886,8 @@ void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) // Delete a particular inventory object by ID. void LLInventoryModel::deleteObject(const LLUUID& id) { - purgeLinkedObjects(id); + // Disabling this; let users manually purge linked objects. + // purgeLinkedObjects(id); lldebugs << "LLInventoryModel::deleteObject()" << llendl; LLPointer obj = getObject(id); if(obj) @@ -923,13 +924,14 @@ void LLInventoryModel::deleteObject(const LLUUID& id) } addChangedMask(LLInventoryObserver::REMOVE, id); obj = NULL; // delete obj + gInventory.notifyObservers(); } } // Delete a particular inventory item by ID, and remove it from the server. void LLInventoryModel::purgeObject(const LLUUID &id) { - lldebugs << "LLInventoryModel::purgeObject()" << llendl; + lldebugs << "LLInventoryModel::purgeObject() [ id: " << id << " ] " << llendl; LLPointer obj = getObject(id); if(obj) { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index dfd4af5c28..583cb341b0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -346,73 +346,76 @@ void LLInventoryPanel::modelChanged(U32 mask) LLInventoryObject* model_item = model->getObject(*id_it); LLFolderViewItem* view_item = mFolders->getItemByID(*id_it); - if (model_item) + // ADD operation + if (model_item && !view_item) { - if (!view_item) + // this object was just created, need to build a view for it + if ((mask & LLInventoryObserver::ADD) != LLInventoryObserver::ADD) { - // this object was just created, need to build a view for it - if ((mask & LLInventoryObserver::ADD) != LLInventoryObserver::ADD) - { - llwarns << *id_it << " is in model but not in view, but ADD flag not set" << llendl; - } - buildNewViews(*id_it); - - // select any newly created object - // that has the auto rename at top of folder - // root set - if(mFolders->getRoot()->needsAutoRename()) - { - setSelection(*id_it, FALSE); - } + llwarns << "( Operation: " << mask << " panel name: " << mStartFolderString << " ) Item in model but not in view, but ADD flag not set [ Name: " << model_item->getName() << " UUID: " << *id_it << " ]" << llendl; } - else + buildNewViews(*id_it); + + // select any newly created object + // that has the auto rename at top of folder + // root set + if(mFolders->getRoot()->needsAutoRename()) { - // this object was probably moved, check its parent - if ((mask & LLInventoryObserver::STRUCTURE) != LLInventoryObserver::STRUCTURE) - { - llwarns << *id_it << " is in model and in view, but STRUCTURE flag not set" << " for model (Name :" << model_item->getName() << " )" << llendl; - } - - LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID()); - - // added check against NULL for cases when Inventory panel contains startFolder. - // in this case parent is LLFolderView (LLInventoryPanel::mFolders) itself. - // this check is a fix for bug EXT-1859. - if (NULL != new_parent && view_item->getParentFolder() != new_parent) - { - view_item->getParentFolder()->extractItem(view_item); - view_item->addToFolder(new_parent, mFolders); - } -/* - on the other side in case Inventory Panel has content of the any folder - it is possible that item moved to some folder which is absent in current - Panel. For ex. removing item (via moving to trash). - In this case we need to check if new parent is other then inventory start folder - and simply remove its View from the hierarchy. - See details in EXT-2098. -*/ - // So, let check if item was moved into folder out of this Inventory Panel. - else if (mStartFolderID.notNull() && NULL == new_parent && model_item->getParentUUID() != mStartFolderID) - { - view_item->getParentFolder()->extractItem(view_item); - } + setSelection(*id_it, FALSE); } } - else + + // STRUCTURE operation + if (model_item && view_item) { - if (view_item) + // this object was probably moved, check its parent + if ((mask & LLInventoryObserver::STRUCTURE) != LLInventoryObserver::STRUCTURE) { - if ((mask & LLInventoryObserver::REMOVE) != LLInventoryObserver::REMOVE) - { - llwarns << *id_it << " is not in model but in view, but REMOVE flag not set" << llendl; - } - // item in view but not model, need to delete view - view_item->destroyView(); + llwarns << "( Operation: " << mask << " panel name: " << mStartFolderString << " ) Item in model and in view, but STRUCTURE flag not set [ Name:" << model_item->getName() << " UUID: " << *id_it << " ]" << llendl; + } + + LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID()); + + // added check against NULL for cases when Inventory panel contains startFolder. + // in this case parent is LLFolderView (LLInventoryPanel::mFolders) itself. + // this check is a fix for bug EXT-1859. + if (NULL != new_parent && view_item->getParentFolder() != new_parent) + { + view_item->getParentFolder()->extractItem(view_item); + view_item->addToFolder(new_parent, mFolders); + } + /* + on the other side in case Inventory Panel has content of the any folder + it is possible that item moved to some folder which is absent in current + Panel. For ex. removing item (via moving to trash). + In this case we need to check if new parent is other then inventory start folder + and simply remove its View from the hierarchy. + See details in EXT-2098. + */ + // So, let check if item was moved into folder out of this Inventory Panel. + else if (mStartFolderID.notNull() && NULL == new_parent && model_item->getParentUUID() != mStartFolderID) + { + view_item->getParentFolder()->extractItem(view_item); } - else + } + + // REMOVE operation + if (!model_item && view_item) + { + if ((mask & LLInventoryObserver::REMOVE) != LLInventoryObserver::REMOVE) { - llwarns << *id_it << "Item does not exist in either view or model, but notification triggered" << llendl; + llwarns << "( Operation: " << mask << " panel name: " << mStartFolderString << " ) Item is not in model but in view, but REMOVE flag not set [ UUID: " << *id_it << " ] " << llendl; } + // item in view but not model, need to delete view + view_item->destroyView(); + } + + // False positive. This item probably just doesn't exist in the + // particular inventory panel (e.g. is outside the root folder of the inventory panel). + // Ignore the operation. + if (!model_item && !view_item) + { + // llwarns << "( Operation: " << mask << " panel name: " << mStartFolderString << " ) Item does not exist in either view or model, but notification triggered [ UUID: " << *id_it << " ] " << llendl; } } } -- cgit v1.2.3