summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-12 20:29:07 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-12 20:29:07 -0500
commit2ea1b06440369d059eb67eb47dc4945975dbdc65 (patch)
tree5f82cbf7f826e51b7705a699df490e12198a406c
parent1bbcc4be8359b177aca093be0b451c12212f8a7d (diff)
Backed out changeset: 153709ddee86
--HG-- branch : avatar-pipeline
-rw-r--r--indra/newview/llappearancemgr.cpp1
-rw-r--r--indra/newview/llinventorybridge.cpp7
-rw-r--r--indra/newview/llinventorymodel.cpp5
-rw-r--r--indra/newview/llinventorypanel.cpp116
4 files changed, 64 insertions, 65 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index e7123d5000..0901289dac 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1167,7 +1167,6 @@ void LLAppearanceManager::removeItemLinks(const LLUUID& item_id, bool do_update)
const LLInventoryItem* item = item_array.get(i).get();
if (item->getLinkedUUID() == item_id)
{
- llinfos << "Purging object " << item->getUUID() << "for linked item " << item->getLinkedUUID() << llendl;
gInventory.purgeObject(item_array.get(i)->getUUID());
}
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 10c4b620df..1bc9297bba 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3889,11 +3889,16 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model
gMessageSystem->sendReliable( gAgent.getRegion()->getHost());
}
// this object might have been selected, so let the selection manager know it's gone now
- LLViewerObject *found_obj = gObjectList.findObject(item->getLinkedUUID());
+ LLViewerObject *found_obj =
+ gObjectList.findObject(item->getUUID());
if (found_obj)
{
LLSelectMgr::getInstance()->remove(found_obj);
}
+ else
+ {
+ llwarns << "object not found - ignoring" << llendl;
+ }
}
else LLItemBridge::performAction(folder, model, action);
}
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index a61f45c2c9..4b0d524906 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -886,7 +886,7 @@ 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);
+ purgeLinkedObjects(id);
lldebugs << "LLInventoryModel::deleteObject()" << llendl;
LLPointer<LLInventoryObject> obj = getObject(id);
if(obj)
@@ -923,14 +923,13 @@ 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() id:" << id << llendl;
+ lldebugs << "LLInventoryModel::purgeObject()" << llendl;
LLPointer<LLInventoryObject> obj = getObject(id);
if(obj)
{
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 1a800b96d1..dfd4af5c28 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -346,77 +346,73 @@ void LLInventoryPanel::modelChanged(U32 mask)
LLInventoryObject* model_item = model->getObject(*id_it);
LLFolderViewItem* view_item = mFolders->getItemByID(*id_it);
- // ADD operation
- if (model_item && !view_item)
+ if (model_item)
{
- // this object was just created, need to build a view for it
- if ((mask & LLInventoryObserver::ADD) != LLInventoryObserver::ADD)
+ if (!view_item)
{
- 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;
+ // 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);
+ }
}
- buildNewViews(*id_it);
-
- // select any newly created object
- // that has the auto rename at top of folder
- // root set
- if(mFolders->getRoot()->needsAutoRename())
+ else
{
- setSelection(*id_it, FALSE);
+ // 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);
+ }
}
}
-
- // STRUCTURE operation
- if (model_item && view_item)
+ else
{
- // this object was probably moved, check its parent
- if ((mask & LLInventoryObserver::STRUCTURE) != LLInventoryObserver::STRUCTURE)
+ if (view_item)
{
- 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);
+ 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();
}
- }
-
- // REMOVE operation
- if (!model_item && view_item)
- {
- if ((mask & LLInventoryObserver::REMOVE) != LLInventoryObserver::REMOVE)
+ else
{
- llwarns << "( Operation: " << mask << " panel name: " << mStartFolderString << " ) Item is not in model but in view, but REMOVE flag not set [ UUID: " << *id_it << " ] " << llendl;
+ llwarns << *id_it << "Item does not exist in either view or model, but notification triggered" << llendl;
}
- // item in view but not model, need to delete view
- view_item->destroyView();
- llinfos << "Deleting " << *id_it << " from " << this << llendl;
- }
-
- // 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;
}
}
}