summaryrefslogtreecommitdiff
path: root/indra/newview/lloutfitgallery.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2017-09-15 16:45:46 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2017-09-15 16:45:46 +0300
commit0b7020c0c57560e8ffd13ea57e378807222e4680 (patch)
tree3af8d82db1677b03eeac4abb2c2df8ffdf3c16d1 /indra/newview/lloutfitgallery.cpp
parent14a6afea84c1fcdabb0282428d143692062463e8 (diff)
MAINT-7801 FIXED "Take a snapshot" fails to assign new snapshot for Outfit if default folder for uploads was changed
Diffstat (limited to 'indra/newview/lloutfitgallery.cpp')
-rw-r--r--indra/newview/lloutfitgallery.cpp28
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();
}
}