summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r--indra/newview/llagentwearables.cpp41
1 files changed, 16 insertions, 25 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 6cb96d1336..538dcb6f3d 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -62,7 +62,7 @@ class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver
{
public:
LLInitialWearablesFetch() {}
- ~LLInitialWearablesFetch() {}
+ ~LLInitialWearablesFetch();
virtual void done();
struct InitialWearableData
@@ -84,7 +84,6 @@ public:
protected:
void processWearablesMessage();
void processContents();
- static void onIdle(void *userdata);
};
class LLLibraryOutfitsFetch : public LLInventoryFetchDescendentsObserver
@@ -654,11 +653,13 @@ LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index)
void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearable *wearable)
{
- if (!getWearable(type,index))
+ LLWearable *old_wearable = getWearable(type,index);
+ if (!old_wearable)
{
pushWearable(type,wearable);
return;
}
+
wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type);
if (wearable_iter == mWearableDatas.end())
{
@@ -673,6 +674,7 @@ void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearab
else
{
wearable_vec[index] = wearable;
+ old_wearable->setLabelUpdated();
mAvatarObject->wearableUpdated(wearable->getType());
}
}
@@ -689,6 +691,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl
{
mWearableDatas[type].push_back(wearable);
mAvatarObject->wearableUpdated(wearable->getType());
+ wearable->setLabelUpdated();
return mWearableDatas[type].size()-1;
}
return MAX_WEARABLES_PER_TYPE;
@@ -718,6 +721,7 @@ void LLAgentWearables::popWearable(const EWearableType type, U32 index)
{
mWearableDatas[type].erase(mWearableDatas[type].begin() + index);
mAvatarObject->wearableUpdated(wearable->getType());
+ wearable->setLabelUpdated();
}
}
@@ -1413,14 +1417,10 @@ void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_rem
for (S32 i=max_entry; i>=0; i--)
{
LLWearable* old_wearable = getWearable(type,i);
- const LLUUID &item_id = getWearableItemID(type,i);
- popWearable(type,i);
- gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
- LLAppearanceManager::instance().removeItemLinks(item_id,false);
-
//queryWearableCache(); // moved below
if (old_wearable)
{
+ popWearable(old_wearable);
old_wearable->removeFromAvatar(TRUE);
}
}
@@ -1429,16 +1429,11 @@ void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_rem
else
{
LLWearable* old_wearable = getWearable(type, index);
-
- const LLUUID &item_id = getWearableItemID(type,index);
- popWearable(type, index);
- gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
- LLAppearanceManager::instance().removeItemLinks(item_id,false);
-
//queryWearableCache(); // moved below
if (old_wearable)
{
+ popWearable(old_wearable);
old_wearable->removeFromAvatar(TRUE);
}
}
@@ -1500,7 +1495,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
continue;
}
- gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
// Assumes existing wearables are not dirty.
if (old_wearable->isDirty())
{
@@ -1509,9 +1503,9 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
}
}
- setWearable(type,0,new_wearable);
if (new_wearable)
new_wearable->setItemID(new_item->getUUID());
+ setWearable(type,0,new_wearable);
}
std::vector<LLWearable*> wearables_being_removed;
@@ -2159,6 +2153,11 @@ void LLLibraryOutfitsFetch::contentsDone(void)
// to avoid gInventory.notifyObservers recursion.
//--------------------------------------------------------------------
+LLInitialWearablesFetch::~LLInitialWearablesFetch()
+{
+ llinfos << "~LLInitialWearablesFetch" << llendl;
+}
+
// virtual
void LLInitialWearablesFetch::done()
{
@@ -2166,15 +2165,7 @@ void LLInitialWearablesFetch::done()
// gInventory.notifyObservers. The results will be handled in the next
// idle tick instead.
gInventory.removeObserver(this);
- gIdleCallbacks.addFunction(onIdle, this);
-}
-
-// static
-void LLInitialWearablesFetch::onIdle(void *data)
-{
- gIdleCallbacks.deleteFunction(onIdle, data);
- LLInitialWearablesFetch *self = reinterpret_cast<LLInitialWearablesFetch*>(data);
- self->processContents();
+ doOnIdle(boost::bind(&LLInitialWearablesFetch::processContents,this));
}
void LLInitialWearablesFetch::processContents()