From 6af7373a271578dde2adb32939b42805ae3838a4 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Sat, 4 Feb 2023 15:47:35 -0500
Subject: [PATCH] Merge fixes

---
 indra/llui/llmenugl.h                     |  4 +-
 indra/newview/{ => app_settings}/cube.dae |  0
 indra/newview/llfloatermodelpreview.cpp   |  4 +-
 indra/newview/llfloatersettingsdebug.cpp  |  2 +-
 indra/newview/llmeshrepository.cpp        |  3 +-
 indra/newview/llviewerwindow.cpp          | 53 -----------------------
 indra/newview/llvovolume.cpp              |  3 --
 indra/newview/llwearableitemslist.cpp     |  5 +--
 indra/newview/viewer_manifest.py          |  6 +--
 9 files changed, 12 insertions(+), 68 deletions(-)
 rename indra/newview/{ => app_settings}/cube.dae (100%)

diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 0adb289c226..43c1d218a0a 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -762,13 +762,13 @@ class LLContextMenuBranch : public LLMenuItemGL
 	// onCommit() - do the primary funcationality of the menu item.
 	virtual void	onCommit( void );
 
-	LLContextMenu*	getBranch() { return mBranchHandle.get(); }
+	LLContextMenu*	getBranch() { return mBranch.get(); }
 	void			setHighlight( BOOL highlight );
 
 protected:
 	void	showSubMenu();
 
-	LLHandle<LLContextMenu> mBranchHandle;
+	LLHandle<LLContextMenu> mBranch;
 };
 
 
diff --git a/indra/newview/cube.dae b/indra/newview/app_settings/cube.dae
similarity index 100%
rename from indra/newview/cube.dae
rename to indra/newview/app_settings/cube.dae
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 73531868a8d..be662c5537b 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1086,8 +1086,8 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
 	}
 	else if (which_mode == cube_mode)
 	{
-		std::string path = gDirUtilp->getAppRODataDir();
-		gDirUtilp->append(path, "cube.dae");
+		
+		std::string path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "cube.dae");
 		sInstance->loadModel(LLModel::LOD_PHYSICS, path);
 	}
 
diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp
index 38b7b713647..52fd182a4fa 100644
--- a/indra/newview/llfloatersettingsdebug.cpp
+++ b/indra/newview/llfloatersettingsdebug.cpp
@@ -40,7 +40,7 @@
 
 
 LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key) 
-:	LLFloater(key.asString().empty() ? LLSD("all") : key)
+:	LLFloater(key.asString().empty() ? LLSD("all") : key),
     mSettingList(NULL)
 {
 	mCommitCallbackRegistrar.add("CommitSettings",	boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this));
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 5fd8d2902d7..339ed39232b 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3969,7 +3969,8 @@ void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVol
 	S32 detail = LLVolumeLODGroup::getVolumeDetailFromScale(volume->getDetail());
 
 	//get list of objects waiting to be notified this mesh is loaded
-	mesh_load_map::iterator obj_iter = mLoadingMeshes[detail].find(mesh_params.getSculptID());
+	const auto& mesh_id = mesh_params.getSculptID();
+	mesh_load_map::iterator obj_iter = mLoadingMeshes[detail].find(mesh_id);
 
 	if (volume && obj_iter != mLoadingMeshes[detail].end())
 	{
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5894032e172..b23e645b3f8 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3482,59 +3482,6 @@ void LLViewerWindow::updateUI()
 		root_view = mRootView;
 	}
 
-	static LLCachedControl<bool> dump_menu_holder(gSavedSettings, "AlchemyDumpMenuHolderSize", false);
-	if (dump_menu_holder)
-	{
-		static bool init = false;
-		static LLFrameTimer child_count_timer;
-		static std::vector <std::string> child_vec;
-		if (!init)
-		{
-			child_count_timer.resetWithExpiry(5.f);
-			init = true;
-		}
-		if (child_count_timer.hasExpired())
-		{
-			LL_INFOS() << "gMenuHolder child count: " << gMenuHolder->getChildCount() << LL_ENDL;
-			std::vector<std::string> local_child_vec;
-			LLView::child_list_t child_list = *gMenuHolder->getChildList();
-			for (auto child : child_list)
-			{
-				local_child_vec.emplace_back(child->getName());
-			}
-			if (!local_child_vec.empty() && local_child_vec != child_vec)
-			{
-				std::vector<std::string> out_vec;
-				std::sort(local_child_vec.begin(), local_child_vec.end());
-				std::sort(child_vec.begin(), child_vec.end());
-				std::set_difference(child_vec.begin(), child_vec.end(), local_child_vec.begin(), local_child_vec.end(), std::inserter(out_vec, out_vec.begin()));
-				if (!out_vec.empty())
-				{
-					LL_INFOS() << "gMenuHolder removal diff size: '"<<out_vec.size() <<"' begin_child_diff";
-					for (auto str : out_vec)
-					{
-						LL_CONT << " : " << str;
-					}
-					LL_CONT << " : end_child_diff" << LL_ENDL;
-				}
-
-				out_vec.clear();
-				std::set_difference(local_child_vec.begin(), local_child_vec.end(), child_vec.begin(), child_vec.end(), std::inserter(out_vec, out_vec.begin()));
-				if (!out_vec.empty())
-				{
-					LL_INFOS() << "gMenuHolder addition diff size: '" << out_vec.size() << "' begin_child_diff";
-					for (auto str : out_vec)
-					{
-						LL_CONT << " : " << str;
-					}
-					LL_CONT << " : end_child_diff" << LL_ENDL;
-				}
-				child_vec.swap(local_child_vec);
-			}
-			child_count_timer.resetWithExpiry(5.f);
-		}
-	}
-
 	static LLCachedControl<bool> dump_floater_view_child (gSavedSettings, "AlchemyDumpFloaterViewSize", false);
 	if (dump_floater_view_child)
 	{
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 6c3fc361064..959eba341ee 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -234,7 +234,6 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
     mColorChanged = FALSE;
 	mSpotLightPriority = 0.f;
 
-	mSkinInfoFailed = false;
 	mSkinInfo = NULL;
 
 	mMediaImplList.resize(getNumTEs());
@@ -1122,7 +1121,6 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
 				if (mSkinInfo && mSkinInfo->mMeshID != volume_params.getSculptID())
 				{
 					mSkinInfo = NULL;
-					mSkinInfoFailed = false;
 				}
 
 				if (!getVolume()->isMeshAssetLoaded())
@@ -1178,7 +1176,6 @@ void LLVOVolume::updateSculptTexture()
 			mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
 		}
 
-		mSkinInfoFailed = false;
 		mSkinInfo = NULL;
 	}
 	else
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 7c40877d989..8712f2e262d 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -110,10 +110,9 @@ BOOL LLPanelWearableOutfitItem::postBuild()
     
     LLViewerInventoryItem* inv_item = getItem();
     mShowWidgets &= (inv_item->getType() != LLAssetType::AT_BODYPART);
-    if(mShowWidgets)
     {
-        addWidgetToRightSide("add_wearable");
-        addWidgetToRightSide("remove_wearable");
+        addWidgetToRightSide("add_wearable", mShowWidgets);
+        addWidgetToRightSide("remove_wearable", mShowWidgets);
 
         childSetAction("add_wearable", boost::bind(&LLPanelWearableOutfitItem::onAddWearable, this));
         childSetAction("remove_wearable", boost::bind(&LLPanelWearableOutfitItem::onRemoveWearable, this));
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 004b92972de..b460889f115 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -77,6 +77,9 @@ def construct(self):
                 # include static assets
                 self.path("static_assets")
 
+                # include the cube
+                self.path("cube.dae")
+
                 # include the entire shaders directory recursively
                 self.path("shaders")
                 # include the extracted list of contributors
@@ -496,7 +499,6 @@ def construct(self):
 
         self.path(src="licenses-win32.txt", dst="licenses.txt")
         self.path("featuretable.txt")
-        self.path("cube.dae")
 
         with self.prefix(src=pkgdir):
             self.path("ca-bundle.crt")
@@ -763,7 +765,6 @@ def construct(self):
 
                 self.path("licenses-mac.txt", dst="licenses.txt")
                 self.path("featuretable_mac.txt")
-                self.path("cube.dae")
 
                 with self.prefix(src=pkgdir,dst=""):
                     self.path("ca-bundle.crt")
@@ -1122,7 +1123,6 @@ def construct(self):
             self.path("*.pak")
 
         self.path("featuretable_linux.txt")
-        self.path("cube.dae")
 
         with self.prefix(src=pkgdir, dst="app_settings"):
             self.path("ca-bundle.crt")
-- 
GitLab