From 3c552696bf8704e30c1525a4f9d4b3dd09034820 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 12 Aug 2019 22:56:15 +0300 Subject: DRTVWR-493 LLWearableType to LLParamSingleton --- indra/llappearance/llwearabletype.cpp | 37 ++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'indra/llappearance/llwearabletype.cpp') diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index cd602b43b4..2dc4703399 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -29,18 +29,6 @@ #include "llinventorytype.h" #include "llinventorydefines.h" -static LLTranslationBridge* sTrans = NULL; - -// static -void LLWearableType::initClass(LLTranslationBridge* trans) -{ - sTrans = trans; -} - -void LLWearableType::cleanupClass() -{ - delete sTrans; -} struct WearableEntry : public LLDictionaryEntry { @@ -53,7 +41,7 @@ struct WearableEntry : public LLDictionaryEntry LLDictionaryEntry(name), mAssetType(assetType), mDefaultNewName(default_new_name), - mLabel(sTrans->getString(name)), + mLabel(LLWearableType::getInstance()->mTrans->getString(name)), mIconName(iconName), mDisableCameraSwitch(disable_camera_switch), mAllowMultiwear(allow_multiwear) @@ -68,7 +56,7 @@ struct WearableEntry : public LLDictionaryEntry BOOL mAllowMultiwear; }; -class LLWearableDictionary : public LLSingleton, +class LLWearableDictionary : public LLParamSingleton, public LLDictionary { LLSINGLETON(LLWearableDictionary); @@ -98,6 +86,27 @@ LLWearableDictionary::LLWearableDictionary() addEntry(LLWearableType::WT_NONE, new WearableEntry("none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE)); } + +// class LLWearableType + +LLWearableType::LLWearableType(LLTranslationBridge* trans) +{ + mTrans = trans; +} + +LLWearableType::~LLWearableType() +{ + delete mTrans; +} + +void LLWearableType::initSingleton() +{ + // To make sure all wrapping functions will crash without initing LLWearableType; + LLWearableDictionary::initParamSingleton(); + + // Todo: consider merging LLWearableType and LLWearableDictionary +} + // static LLWearableType::EType LLWearableType::typeNameToType(const std::string& type_name) { -- cgit v1.2.3