From 6f7e50e2b21077dda6583f3add1521f3ba83bc19 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 22 May 2024 12:45:54 +0300 Subject: viewer#1425 Fix missed 'static' declarations --- indra/newview/llinventorybridge.cpp | 4 ++-- indra/newview/lloutfitgallery.cpp | 8 ++++---- indra/newview/lloutfitslist.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index aa6d747622..5e57a4512e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1208,8 +1208,8 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, LLInventoryModel::cat_array_t categories; LLInventoryModel::item_array_t items; gInventory.collectDescendents(local_version_folder_id, categories, items, FALSE); - LLCachedControl max_depth(gSavedSettings, "InventoryOutboxMaxFolderDepth", 4); - LLCachedControl max_count(gSavedSettings, "InventoryOutboxMaxFolderCount", 20); + static LLCachedControl max_depth(gSavedSettings, "InventoryOutboxMaxFolderDepth", 4); + static LLCachedControl max_count(gSavedSettings, "InventoryOutboxMaxFolderCount", 20); if (categories.size() >= max_count || depth > (max_depth + 1)) { diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index c428a4ea92..642335b2b4 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -423,7 +423,7 @@ void LLOutfitGallery::updateRowsIfNeeded() bool compareGalleryItem(LLOutfitGalleryItem* item1, LLOutfitGalleryItem* item2) { - LLCachedControl sort_by_name(gSavedSettings, "OutfitGallerySortOrder", 0); + static LLCachedControl sort_by_name(gSavedSettings, "OutfitGallerySortOrder", 0); switch (sort_by_name()) { case 2: @@ -1047,7 +1047,7 @@ void LLOutfitGalleryItem::setOutfitFavorite(bool is_favorite) { mFavorite = is_favorite; - LLCachedControl use_color(gSavedSettings, "InventoryFavoritesColorText"); + static LLCachedControl use_color(gSavedSettings, "InventoryFavoritesColorText"); mOutfitNameText->setReadOnlyColor((mFavorite && use_color()) ? sDefaultFavoriteColor.get() : sDefaultTextColor.get()); } @@ -1062,7 +1062,7 @@ void LLOutfitGalleryItem::setOutfitWorn(bool value) mOutfitWornText->setValue(value ? worn_string : ""); mOutfitNameText->setText(mOutfitName); // refresh LLTextViewModel to pick up font changes - LLCachedControl use_color(gSavedSettings, "InventoryFavoritesColorText"); + static LLCachedControl use_color(gSavedSettings, "InventoryFavoritesColorText"); mOutfitNameText->setReadOnlyColor((mFavorite && use_color()) ? sDefaultFavoriteColor.get() : sDefaultTextColor.get()); } @@ -1414,7 +1414,7 @@ void LLOutfitGallerySortMenu::onUpdateItemsVisibility() bool LLOutfitGallerySortMenu::onEnable(LLSD::String param) { - LLCachedControl sort_order(gSavedSettings, "OutfitGallerySortOrder", 0); + static LLCachedControl sort_order(gSavedSettings, "OutfitGallerySortOrder", 0); if ("favorites_to_top" == param) { return sort_order == 2; diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index c0f13cc75f..66d8bff18f 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -225,7 +225,7 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id) tab->setDropDownStateChangedCallback(boost::bind(&LLOutfitsList::resetItemSelection, this, list, cat_id)); // Depending on settings, force showing list items that don't match current filter(EXT-7158) - LLCachedControl list_filter(gSavedSettings, "OutfitListFilterFullList"); + static LLCachedControl list_filter(gSavedSettings, "OutfitListFilterFullList"); list->setForceShowingUnmatchedItems(list_filter(), false); // Setting list commit callback to monitor currently selected wearable item. @@ -1556,12 +1556,12 @@ bool LLOutfitListSortMenu::onEnable(LLSD::String param) { if ("favorites_to_top" == param) { - LLCachedControl sort_order(gSavedSettings, "OutfitListSortOrder", 0); + static LLCachedControl sort_order(gSavedSettings, "OutfitListSortOrder", 0); return sort_order == 1; } else if ("show_entire_outfit" == param) { - LLCachedControl filter_mode(gSavedSettings, "OutfitListFilterFullList", 0); + static LLCachedControl filter_mode(gSavedSettings, "OutfitListFilterFullList", 0); return filter_mode; } -- cgit v1.2.3 From bd8438f7083643ae5812b14e35e69e69ef1616c6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 7 Jun 2024 12:07:40 +0300 Subject: viewer#1619 Fix outfits search pulling up results sometimes Search forces a refresh - can search items that don't exist yet Always notify parent of rect changes despite visibility (alterantively - rearrange on open) --- indra/newview/llinventoryitemslist.cpp | 2 +- indra/newview/lloutfitslist.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index cac859387c..c6042142eb 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -115,7 +115,7 @@ void LLInventoryItemsList::doIdle() { if (mRefreshState == REFRESH_COMPLETE) return; - if (isInVisibleChain() || mForceRefresh ) + if (isInVisibleChain() || mForceRefresh || !getFilterSubString().empty()) { refresh(); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 66d8bff18f..273eecda80 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -567,7 +567,7 @@ void LLOutfitsList::onFilterSubStringChanged(const std::string& new_string, cons LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); if (list) { - list->setFilterSubString(new_string, tab->getDisplayChildren()); + list->setFilterSubString(new_string, true); } if (old_string.empty()) -- cgit v1.2.3 From d1cf13f31e75807500aff0cf49812a76aff2bd74 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 10 Jun 2024 16:03:00 +0300 Subject: viewer#1673 Crash calling dirtyDescendantsFilter --- indra/newview/llinventorypanel.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index ad9099cd6e..33d9f08e14 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -565,7 +565,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve view_item->refresh(); } LLFolderViewFolder* parent = view_item->getParentFolder(); - if(parent) + if(parent && parent->getViewModelItem()) { parent->getViewModelItem()->dirtyDescendantsFilter(); } @@ -616,7 +616,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve // Sort the folder. if (mask & LLInventoryObserver::SORT) { - if (view_folder) + if (view_folder && view_folder->getViewModelItem()) { view_folder->getViewModelItem()->requestSort(); } @@ -684,7 +684,8 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve // Don't process the item if it is the root if (old_parent) { - LLFolderViewModelItemInventory* viewmodel_folder = static_cast(old_parent->getViewModelItem()); + LLFolderViewModelItem* old_parent_vmi = old_parent->getViewModelItem(); + LLFolderViewModelItemInventory* viewmodel_folder = static_cast(old_parent_vmi); LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID()); // Item has been moved. if (old_parent != new_parent) @@ -718,7 +719,10 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve { updateFolderLabel(viewmodel_folder->getUUID()); } - old_parent->getViewModelItem()->dirtyDescendantsFilter(); + if (old_parent_vmi) + { + old_parent_vmi->dirtyDescendantsFilter(); + } if (view_item->isFavorite()) { @@ -740,11 +744,15 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve view_item->destroyView(); if(parent) { - parent->getViewModelItem()->dirtyDescendantsFilter(); - LLFolderViewModelItemInventory* viewmodel_folder = static_cast(parent->getViewModelItem()); - if(viewmodel_folder) + LLFolderViewModelItem* parent_wmi = parent->getViewModelItem(); + if (parent_wmi) { - updateFolderLabel(viewmodel_folder->getUUID()); + parent_wmi->dirtyDescendantsFilter(); + LLFolderViewModelItemInventory* viewmodel_folder = static_cast(parent_wmi); + if (viewmodel_folder) + { + updateFolderLabel(viewmodel_folder->getUUID()); + } } if (view_item->isFavorite()) { -- cgit v1.2.3 From 7ae63daff1e1834cc863856df4f731773cc2ad23 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 14 Jun 2024 22:49:38 +0300 Subject: viewer#1300 Increment inventory cache for favorites --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 5677e346b1..eeb0232890 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -78,7 +78,7 @@ // Increment this if the inventory contents change in a non-backwards-compatible way. // For viewer 2, the addition of link items makes a pre-viewer-2 cache incorrect. -const S32 LLInventoryModel::sCurrentInvCacheVersion = 3; +const S32 LLInventoryModel::sCurrentInvCacheVersion = 4; BOOL LLInventoryModel::sFirstTimeInViewer2 = TRUE; S32 LLInventoryModel::sPendingSystemFolders = 0; -- cgit v1.2.3