summaryrefslogtreecommitdiff
path: root/indra/llappearance/llwearabletype.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-13 10:50:25 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-13 10:50:25 +0200
commitf83ada32f728740254668792f9d77b5745d80d2e (patch)
tree593a31ab109e1e8b088d0c2a5536e73cb6b9a050 /indra/llappearance/llwearabletype.cpp
parentb1ac8092eecf5fc9dc4b4867370a51e5dfba4331 (diff)
parent78bdf57ad6610b34389226bf941ba736ca0c2225 (diff)
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/llappearance/llwearabletype.cpp')
-rw-r--r--indra/llappearance/llwearabletype.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp
index 0e29bbe783..6b7dc41ffd 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<LLWearableDictionary>,
+class LLWearableDictionary : public LLParamSingleton<LLWearableDictionary>,
public LLDictionary<LLWearableType::EType, WearableEntry>
{
LLSINGLETON(LLWearableDictionary);
@@ -99,6 +87,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)
{