diff options
author | callum_linden <callum@lindenlab.com> | 2017-12-11 10:09:44 -0800 |
---|---|---|
committer | callum_linden <callum@lindenlab.com> | 2017-12-11 10:09:44 -0800 |
commit | 5561673bf1c98c717f69e747a9e8b0d56129ef12 (patch) | |
tree | f021c5beca7aaad132c60d25881c7920a9944daf /indra/newview/lloutfitgallery.cpp | |
parent | fe29551d9a6685bdc40e87ae135f236aec1ea475 (diff) | |
parent | c565c62745ec37484118888f8f45dbde34d42e46 (diff) |
Automated merge with tip of viewer64 *plus* update to CEF 3.3202.1686 / Dullahan 901
Diffstat (limited to 'indra/newview/lloutfitgallery.cpp')
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index cca65f2ce1..c38d3ab140 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -72,6 +72,7 @@ LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p) mItemsAddedCount(0), mOutfitLinkPending(NULL), mOutfitRenamePending(NULL), + mSnapshotFolderID(NULL), mRowPanelHeight(p.row_panel_height), mVerticalGap(p.vertical_gap), mHorizontalGap(p.horizontal_gap), @@ -1011,8 +1012,8 @@ void LLOutfitGallery::onTextureSelectionChanged(LLInventoryItem* itemp) void LLOutfitGallery::loadPhotos() { //Iterate over inventory - LLUUID textures = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE); - LLViewerInventoryCategory* textures_category = gInventory.getCategory(textures); + mSnapshotFolderID = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE); + LLViewerInventoryCategory* textures_category = gInventory.getCategory(mSnapshotFolderID); if (!textures_category) return; if (mTexturesObserver == NULL) @@ -1022,12 +1023,26 @@ void LLOutfitGallery::loadPhotos() } // Start observing changes in "Textures" category. - mTexturesObserver->addCategory(textures, - boost::bind(&LLOutfitGallery::refreshTextures, this, textures)); - + mTexturesObserver->addCategory(mSnapshotFolderID, + boost::bind(&LLOutfitGallery::refreshTextures, this, mSnapshotFolderID)); + textures_category->fetch(); } +void LLOutfitGallery::updateSnapshotFolderObserver() +{ + if(mSnapshotFolderID != gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE)) + { + if (gInventory.containsObserver(mTexturesObserver)) + { + gInventory.removeObserver(mTexturesObserver); + } + delete mTexturesObserver; + mTexturesObserver = NULL; + loadPhotos(); + } +} + void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) { LLViewerInventoryCategory* category = gInventory.getCategory(category_id); @@ -1200,7 +1215,7 @@ void LLOutfitGallery::uploadPhoto(LLUUID outfit_id) LLViewerInventoryCategory *outfit_cat = gInventory.getCategory(outfit_id); if (!outfit_cat) return; - + updateSnapshotFolderObserver(); checkRemovePhoto(outfit_id); std::string upload_pending_name = outfit_id.asString(); std::string upload_pending_desc = ""; @@ -1372,6 +1387,7 @@ void LLOutfitGallery::onBeforeOutfitSnapshotSave() if (!selected_outfit_id.isNull()) { checkRemovePhoto(selected_outfit_id); + updateSnapshotFolderObserver(); } } |