diff options
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(); + } } |