summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-21 23:59:03 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-21 23:59:03 +0200
commit24f8f47d46b9f04d2c14571fd83e1f683296ff2f (patch)
tree0aaa640e77efc7bfe6ae3103aec7bba2d11cfc5f /indra/newview
parent19e9b5d488e5478d6c5ecbb85000e6da3e6124bb (diff)
SL-19188 Fix thumbnail changes being ignored by outfit gallery
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventoryobserver.cpp19
-rw-r--r--indra/newview/llinventoryobserver.h5
-rw-r--r--indra/newview/lloutfitgallery.cpp4
-rw-r--r--indra/newview/lloutfitgallery.h14
4 files changed, 19 insertions, 23 deletions
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index 26d7a7a28a..b884721895 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -649,6 +649,13 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
}
}
+ const LLUUID thumbnail_id = category->getThumbnailUUID();
+ if (cat_data.mThumbnailId != thumbnail_id)
+ {
+ cat_data.mThumbnailId = thumbnail_id;
+ cat_changed = true;
+ }
+
// If anything has changed above, fire the callback.
if (cat_changed)
cat_data.mCallback();
@@ -666,6 +673,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
S32 version = LLViewerInventoryCategory::VERSION_UNKNOWN;
S32 current_num_known_descendents = LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN;
bool can_be_added = true;
+ LLUUID thumbnail_id;
LLViewerInventoryCategory* category = gInventory.getCategory(cat_id);
// If category could not be retrieved it might mean that
@@ -677,6 +685,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
// Inventory category version is used to find out if some changes
// to a category have been made.
version = category->getVersion();
+ thumbnail_id = category->getThumbnailUUID();
LLInventoryModel::cat_array_t* cats;
LLInventoryModel::item_array_t* items;
@@ -702,11 +711,11 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
if(init_name_hash)
{
LLMD5 item_name_hash = gInventory.hashDirectDescendentNames(cat_id);
- mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, cb, version, current_num_known_descendents,item_name_hash)));
+ mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, cb, version, current_num_known_descendents,item_name_hash)));
}
else
{
- mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, cb, version, current_num_known_descendents)));
+ mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, cb, version, current_num_known_descendents)));
}
}
@@ -719,24 +728,26 @@ void LLInventoryCategoriesObserver::removeCategory(const LLUUID& cat_id)
}
LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData(
- const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents)
+ const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents)
: mCatID(cat_id)
, mCallback(cb)
, mVersion(version)
, mDescendentsCount(num_descendents)
+ , mThumbnailId(thumbnail_id)
, mIsNameHashInitialized(false)
{
mItemNameHash.finalize();
}
LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData(
- const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash)
+ const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash)
: mCatID(cat_id)
, mCallback(cb)
, mVersion(version)
, mDescendentsCount(num_descendents)
+ , mThumbnailId(thumbnail_id)
, mIsNameHashInitialized(true)
, mItemNameHash(name_hash)
{
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h
index 36d8ee3f59..02f73a5892 100644
--- a/indra/newview/llinventoryobserver.h
+++ b/indra/newview/llinventoryobserver.h
@@ -273,14 +273,15 @@ public:
protected:
struct LLCategoryData
{
- LLCategoryData(const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents);
- LLCategoryData(const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash);
+ LLCategoryData(const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents);
+ LLCategoryData(const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash);
callback_t mCallback;
S32 mVersion;
S32 mDescendentsCount;
LLMD5 mItemNameHash;
bool mIsNameHashInitialized;
LLUUID mCatID;
+ LLUUID mThumbnailId;
};
typedef std::map<LLUUID, LLCategoryData> category_map_t;
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index a275af1565..6ea1bfc54a 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -1021,10 +1021,6 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)
}
}
-void LLUpdateGalleryOnPhotoLinked::fire(const LLUUID& inv_item_id)
-{
-}
-
LLUUID LLOutfitGallery::getPhotoAssetId(const LLUUID& outfit_id)
{
outfit_map_t::iterator outfit_it = mOutfitMap.find(outfit_id);
diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h
index 210e436b96..5c417cf7ee 100644
--- a/indra/newview/lloutfitgallery.h
+++ b/indra/newview/lloutfitgallery.h
@@ -43,15 +43,6 @@ class LLOutfitListGearMenuBase;
class LLOutfitGalleryGearMenu;
class LLOutfitGalleryContextMenu;
-class LLUpdateGalleryOnPhotoLinked : public LLInventoryCallback
-{
-public:
- LLUpdateGalleryOnPhotoLinked(){}
- virtual ~LLUpdateGalleryOnPhotoLinked(){}
- /* virtual */ void fire(const LLUUID& inv_item_id);
-private:
-};
-
class LLOutfitGallery : public LLOutfitListBase
{
public:
@@ -82,10 +73,7 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& info);
- /*virtual*/ void draw();
-
- void onSelectPhoto(LLUUID selected_outfit_id);
- void onTakeSnapshot(LLUUID selected_outfit_id);
+ /*virtual*/ void draw();
void wearSelectedOutfit();