diff options
author | Dessie Linden <dessie@lindenlab.com> | 2010-06-11 11:51:59 -0700 |
---|---|---|
committer | Dessie Linden <dessie@lindenlab.com> | 2010-06-11 11:51:59 -0700 |
commit | 9461316e56b99f96ac2d455fabe2af675d7a2391 (patch) | |
tree | d106c28f7ca1bd8c196e32817130fde999bde63c /indra/newview/lloutfitobserver.cpp | |
parent | 6b7470480692fc614d625212f9c17afd688e42de (diff) | |
parent | 571c2bc5e5190cae7324dd235f9c44db9823327a (diff) |
Merged from viewer-release
Diffstat (limited to 'indra/newview/lloutfitobserver.cpp')
-rw-r--r-- | indra/newview/lloutfitobserver.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/indra/newview/lloutfitobserver.cpp b/indra/newview/lloutfitobserver.cpp index 848b595613..efa01bade9 100644 --- a/indra/newview/lloutfitobserver.cpp +++ b/indra/newview/lloutfitobserver.cpp @@ -56,9 +56,9 @@ void LLOutfitObserver::changed(U32 mask) if (!gInventory.isInventoryUsable()) return; - bool panel_updated = checkCOF(); + bool COF_changed = checkCOF(); - if (!panel_updated) + if (!COF_changed) { checkBaseOutfit(); } @@ -74,6 +74,16 @@ S32 LLOutfitObserver::getCategoryVersion(const LLUUID& cat_id) return cat->getVersion(); } +// static +const std::string& LLOutfitObserver::getCategoryName(const LLUUID& cat_id) +{ + LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); + if (!cat) + return LLStringUtil::null; + + return cat->getName(); +} + bool LLOutfitObserver::checkCOF() { LLUUID cof = LLAppearanceMgr::getInstance()->getCOF(); @@ -87,6 +97,7 @@ bool LLOutfitObserver::checkCOF() mCOFLastVersion = cof_version; + // dirtiness state should be updated before sending signal LLAppearanceMgr::getInstance()->updateIsDirty(); mCOFChanged(); @@ -104,8 +115,11 @@ void LLOutfitObserver::checkBaseOutfit() return; const S32 baseoutfit_ver = getCategoryVersion(baseoutfit_id); + const std::string& baseoutfit_name = getCategoryName(baseoutfit_id); - if (baseoutfit_ver == mBaseOutfitLastVersion) + if (baseoutfit_ver == mBaseOutfitLastVersion + // renaming category doesn't change version, so it's need to check it + && baseoutfit_name == mLastBaseOutfitName) return; } else @@ -115,11 +129,22 @@ void LLOutfitObserver::checkBaseOutfit() if (baseoutfit_id.isNull()) return; - - mBaseOutfitLastVersion = getCategoryVersion(mBaseOutfitId); } + mBaseOutfitLastVersion = getCategoryVersion(mBaseOutfitId); + mLastBaseOutfitName = getCategoryName(baseoutfit_id); + LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance(); + // dirtiness state should be updated before sending signal app_mgr.updateIsDirty(); mBOFChanged(); + + if (mLastOutfitDirtiness != app_mgr.isOutfitDirty()) + { + if(!app_mgr.isOutfitDirty()) + { + mCOFSaved(); + } + mLastOutfitDirtiness = app_mgr.isOutfitDirty(); + } } |