diff options
Diffstat (limited to 'indra/newview/llwearablelist.cpp')
-rw-r--r-- | indra/newview/llwearablelist.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index da62223aac..b2de31218b 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -38,9 +38,8 @@ #include "llassetstorage.h" #include "llagent.h" #include "llvoavatar.h" -#include "llviewerinventory.h" #include "llviewerstats.h" -#include "llnotify.h" +#include "llnotificationsutil.h" #include "llinventorymodel.h" #include "lltrans.h" @@ -70,6 +69,11 @@ struct LLWearableArrivedData LLWearableList::~LLWearableList() { + llassert_always(mList.empty()) ; +} + +void LLWearableList::cleanup() +{ for_each(mList.begin(), mList.end(), DeletePairedPointer()); mList.clear(); } @@ -182,16 +186,16 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID args["TYPE"] =LLTrans::getString(LLAssetType::lookupHumanReadable(data->mAssetType)); if (isNewWearable) { - LLNotifications::instance().add("InvalidWearable"); + LLNotificationsUtil::add("InvalidWearable"); } else if (data->mName.empty()) { - LLNotifications::instance().add("FailedToFindWearableUnnamed", args); + LLNotificationsUtil::add("FailedToFindWearableUnnamed", args); } else { args["DESC"] = data->mName; - LLNotifications::instance().add("FailedToFindWearable", args); + LLNotificationsUtil::add("FailedToFindWearable", args); } } // Always call callback; wearable will be NULL if we failed @@ -231,8 +235,9 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type ) LLWearable *wearable = generateNewWearable(); wearable->setType( type ); - std::string name = "New "; - name.append( wearable->getTypeLabel() ); + LLSD item_name = LLSD().with("[WEARABLE_ITEM]", wearable->getTypeLabel()); + std::string name = LLTrans::getString("NewWearable"); + LLStringUtil::format(name, item_name); wearable->setName( name ); LLPermissions perm; @@ -244,9 +249,13 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type ) wearable->setParamsToDefaults(); wearable->setTexturesToDefaults(); + //mark all values (params & images) as saved + wearable->saveValues(); + // Send to the dataserver wearable->saveNewAsset(); + return wearable; } |