summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-11-03 13:49:47 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-11-09 13:54:42 -0800
commitee8b96f3ef55d10f5b84e368c052692a362ebcbc (patch)
treec0295764c0e72488796fd9e4d4d1f02ea79efba8 /indra
parent2d69611c470e8ca0f85f6ad5857799ca2536f193 (diff)
SL-20553: Clean up dead code
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llmaterialeditor.cpp58
-rw-r--r--indra/newview/llmaterialeditor.h1
-rw-r--r--indra/newview/llviewerinventory.cpp61
-rw-r--r--indra/newview/llviewerinventory.h5
4 files changed, 2 insertions, 123 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index cc7e69d60c..958925c9e4 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -2123,63 +2123,9 @@ void LLMaterialEditor::saveObjectsMaterialAs(const LLGLTFMaterial* render_materi
}
else
{
- if (item_id.notNull() && object_id.notNull())
- {
- llassert(false); // *TODO: Remove this code path if unused
- // Copy existing item from object inventory, and create new composite asset on top of it
- LLNotificationsUtil::add("SaveMaterialAs", args, payload, boost::bind(&LLMaterialEditor::onCopyObjectsMaterialAsMsgCallback, _1, _2, permissions, object_id, item_id));
- }
- else
- {
- LLNotificationsUtil::add("SaveMaterialAs", args, payload, boost::bind(&LLMaterialEditor::onSaveObjectsMaterialAsMsgCallback, _1, _2, permissions));
- }
- }
-}
-
-// static
-void LLMaterialEditor::onCopyObjectsMaterialAsMsgCallback(const LLSD& notification, const LLSD& response, const LLPermissions& permissions, const LLUUID& object_id, const LLUUID& item_id)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if (0 != option)
- {
- return;
+ llassert(object_id.isNull()); // Case for copying item from object inventory is no longer implemented
+ LLNotificationsUtil::add("SaveMaterialAs", args, payload, boost::bind(&LLMaterialEditor::onSaveObjectsMaterialAsMsgCallback, _1, _2, permissions));
}
-
- LLSD asset;
- asset["version"] = LLGLTFMaterial::ASSET_VERSION;
- asset["type"] = LLGLTFMaterial::ASSET_TYPE;
- // This is the string serialized from LLGLTFMaterial::asJSON
- asset["data"] = notification["payload"]["data"];
-
- std::ostringstream str;
- LLSDSerialize::serialize(asset, str, LLSDSerialize::LLSD_BINARY);
-
- LLViewerObject* object = gObjectList.findObject(object_id);
- if (!object)
- {
- return;
- }
- const LLInventoryItem* item = object->getInventoryItem(item_id);
- if (!item)
- {
- return;
- }
-
- std::string new_name = response["message"].asString();
- LLInventoryObject::correctInventoryName(new_name);
- if (new_name.empty())
- {
- return;
- }
-
- const LLUUID destination_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MATERIAL);
-
- LLPointer<LLInventoryCallback> cb = new LLObjectsMaterialItemCallback(permissions, str.str(), new_name);
- // NOTE: This should be an item copy. Saving a material to an inventory should be disabled when the associated material is no-copy.
- move_or_copy_inventory_from_object(destination_id,
- object_id,
- item_id,
- cb);
}
// static
diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h
index 1c40fcc348..2e25a9ca3d 100644
--- a/indra/newview/llmaterialeditor.h
+++ b/indra/newview/llmaterialeditor.h
@@ -116,7 +116,6 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener
static bool canSaveObjectsMaterial();
static bool canClipboardObjectsMaterial();
static void saveObjectsMaterialAs();
- static void onCopyObjectsMaterialAsMsgCallback(const LLSD& notification, const LLSD& response, const LLPermissions& permissions, const LLUUID& object_id, const LLUUID& item_id);
static void onSaveObjectsMaterialAsMsgCallback(const LLSD& notification, const LLSD& response, const LLPermissions& permissions);
static void onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status);
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 5ee613d49d..1b70e5f84f 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1658,67 +1658,6 @@ void copy_inventory_from_notecard(const LLUUID& destination_id,
}
}
-void move_or_copy_inventory_from_object(const LLUUID& destination_id,
- const LLUUID& object_id,
- const LLUUID& item_id,
- LLPointer<LLInventoryCallback> cb)
-{
- LLViewerObject* object = gObjectList.findObject(object_id);
- if (!object)
- {
- return;
- }
- const LLInventoryItem* item = object->getInventoryItem(item_id);
- if (!item)
- {
- return;
- }
-
- class LLItemAddedObserver : public LLInventoryObserver
- {
- public:
- LLItemAddedObserver(const LLUUID& copied_asset_id, LLPointer<LLInventoryCallback> cb)
- : LLInventoryObserver(),
- mAssetId(copied_asset_id),
- mCallback(cb)
- {
- }
-
- void changed(U32 mask) override
- {
- if((mask & (LLInventoryObserver::ADD)) == 0)
- {
- return;
- }
- for (const LLUUID& changed_id : gInventory.getChangedIDs())
- {
- LLViewerInventoryItem* changed_item = gInventory.getItem(changed_id);
- if (changed_item->getAssetUUID() == mAssetId)
- {
- changeComplete(changed_item->getUUID());
- return;
- }
- }
- }
-
- private:
- void changeComplete(const LLUUID& item_id)
- {
- mCallback->fire(item_id);
- gInventory.removeObserver(this);
- delete this;
- }
-
- LLUUID mAssetId;
- LLPointer<LLInventoryCallback> mCallback;
- };
-
- const LLUUID& asset_id = item->getAssetUUID();
- LLItemAddedObserver* observer = new LLItemAddedObserver(asset_id, cb);
- gInventory.addObserver(observer);
- object->moveInventory(destination_id, item_id);
-}
-
void create_new_item(const std::string& name,
const LLUUID& parent_id,
LLAssetType::EType asset_type,
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index bce8da0a69..e043285ffb 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -463,11 +463,6 @@ void copy_inventory_from_notecard(const LLUUID& destination_id,
const LLInventoryItem *src,
U32 callback_id = 0);
-void move_or_copy_inventory_from_object(const LLUUID& destination_id,
- const LLUUID& object_id,
- const LLUUID& item_id,
- LLPointer<LLInventoryCallback> cb);
-
void menu_create_inventory_item(LLInventoryPanel* root,
LLFolderBridge* bridge,
const LLSD& userdata,