diff options
Diffstat (limited to 'linden/indra/newview/llfloaternamedesc.cpp')
-rw-r--r-- | linden/indra/newview/llfloaternamedesc.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/linden/indra/newview/llfloaternamedesc.cpp b/linden/indra/newview/llfloaternamedesc.cpp index eddb4b3..3cafdd1 100644 --- a/linden/indra/newview/llfloaternamedesc.cpp +++ b/linden/indra/newview/llfloaternamedesc.cpp | |||
@@ -46,6 +46,7 @@ | |||
46 | #include "llviewercontrol.h" | 46 | #include "llviewercontrol.h" |
47 | #include "llviewermenufile.h" // upload_new_resource() | 47 | #include "llviewermenufile.h" // upload_new_resource() |
48 | #include "lluictrlfactory.h" | 48 | #include "lluictrlfactory.h" |
49 | #include "llstring.h" | ||
49 | 50 | ||
50 | // linden includes | 51 | // linden includes |
51 | #include "llassetstorage.h" | 52 | #include "llassetstorage.h" |
@@ -65,13 +66,12 @@ const S32 PREF_BUTTON_HEIGHT = 16; | |||
65 | // LLFloaterNameDesc() | 66 | // LLFloaterNameDesc() |
66 | //----------------------------------------------------------------------------- | 67 | //----------------------------------------------------------------------------- |
67 | LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename ) | 68 | LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename ) |
68 | : | 69 | : LLFloater(std::string("Name/Description Floater")) |
69 | LLFloater("Name/Description Floater") | ||
70 | { | 70 | { |
71 | mFilenameAndPath = filename; | 71 | mFilenameAndPath = filename; |
72 | mFilename.assign(strrchr( filename.c_str(), gDirUtilp->getDirDelimiter()[0]) + 1); | 72 | mFilename = gDirUtilp->getBaseFileName(filename, false); |
73 | // SL-5521 Maintain capitalization of filename when making the inventory item. JC | 73 | // SL-5521 Maintain capitalization of filename when making the inventory item. JC |
74 | //LLString::toLower(mFilename); | 74 | //LLStringUtil::toLower(mFilename); |
75 | mIsAudio = FALSE; | 75 | mIsAudio = FALSE; |
76 | } | 76 | } |
77 | 77 | ||
@@ -82,27 +82,18 @@ BOOL LLFloaterNameDesc::postBuild() | |||
82 | { | 82 | { |
83 | LLRect r; | 83 | LLRect r; |
84 | 84 | ||
85 | LLString asset_name = mFilename; | 85 | std::string asset_name = mFilename; |
86 | LLString::replaceNonstandardASCII( asset_name, '?' ); | 86 | LLStringUtil::replaceNonstandardASCII( asset_name, '?' ); |
87 | LLString::replaceChar(asset_name, '|', '?'); | 87 | LLStringUtil::replaceChar(asset_name, '|', '?'); |
88 | LLString::stripNonprintable(asset_name); | 88 | LLStringUtil::stripNonprintable(asset_name); |
89 | LLString::trim(asset_name); | 89 | LLStringUtil::trim(asset_name); |
90 | 90 | ||
91 | char* asset_name_str = (char*)asset_name.c_str(); | 91 | std::string exten = gDirUtilp->getExtension(asset_name); |
92 | char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists | 92 | if (exten == "wav") |
93 | if( !end_p ) | ||
94 | { | ||
95 | end_p = asset_name_str + strlen( asset_name_str ); /* Flawfinder: ignore */ | ||
96 | } | ||
97 | else | ||
98 | if( !stricmp( end_p, ".wav") ) | ||
99 | { | 93 | { |
100 | mIsAudio = TRUE; | 94 | mIsAudio = TRUE; |
101 | } | 95 | } |
102 | 96 | asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion | |
103 | S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); | ||
104 | |||
105 | asset_name = asset_name.substr( 0, len ); | ||
106 | 97 | ||
107 | setTitle(mFilename); | 98 | setTitle(mFilename); |
108 | 99 | ||