From d6ede8e81cad497a6cd8482dfb48c99bdf5c258a Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 30 Jul 2018 15:54:36 -0700 Subject: MAINT-8904: Creating new setting in inventory now causes simulator to assign default asset ID to inventory item. --- indra/newview/llviewerinventory.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'indra/newview/llviewerinventory.cpp') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 09b07b83b8..e4d3d73a3e 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1823,37 +1823,29 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge, } else if (("sky" == type_name) || ("water" == type_name) || ("daycycle" == type_name)) { - LLSettingsBase::ptr_t settings; - std::string name; + LLSettingsType::type_e stype(LLSettingsType::ST_NONE); if ("sky" == type_name) { - settings = LLSettingsVOSky::buildDefaultSky(); - name = LLTrans::getString("New Sky"); + stype = LLSettingsType::ST_SKY; } else if ("water" == type_name) { - settings = LLSettingsVOWater::buildDefaultWater(); - name = LLTrans::getString("New Water"); + stype = LLSettingsType::ST_WATER; } else if ("daycycle" == type_name) { - settings = LLSettingsVODay::buildDefaultDayCycle(); - name = LLTrans::getString("New Daycycle"); + stype = LLSettingsType::ST_DAYCYCLE; } else - LL_ERRS(LOG_INV) << "Unknown settings type: '" << type_name << "'" << LL_ENDL; - - if (!settings) { - LL_WARNS(LOG_INV) << "Unable to create a default setting object of type '" << type_name << "'" << LL_ENDL; + LL_ERRS(LOG_INV) << "Unknown settings type: '" << type_name << "'" << LL_ENDL; return; } LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); - settings->setName(name); - LLSettingsVOBase::createInventoryItem(settings, parent_id); + LLSettingsVOBase::createNewInventoryItem(stype, parent_id); } else { -- cgit v1.2.3