diff options
Diffstat (limited to 'linden/indra/newview/llpaneldirbrowser.cpp')
-rw-r--r-- | linden/indra/newview/llpaneldirbrowser.cpp | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/linden/indra/newview/llpaneldirbrowser.cpp b/linden/indra/newview/llpaneldirbrowser.cpp index 5d3236d..cd9e6ae 100644 --- a/linden/indra/newview/llpaneldirbrowser.cpp +++ b/linden/indra/newview/llpaneldirbrowser.cpp | |||
@@ -69,6 +69,11 @@ | |||
69 | #include "llviewermessage.h" | 69 | #include "llviewermessage.h" |
70 | #include "llvieweruictrlfactory.h" | 70 | #include "llvieweruictrlfactory.h" |
71 | 71 | ||
72 | #include <string> | ||
73 | #include <sstream> | ||
74 | #include <vector> | ||
75 | #include <algorithm> | ||
76 | |||
72 | 77 | ||
73 | // | 78 | // |
74 | // Globals | 79 | // Globals |
@@ -203,7 +208,7 @@ void LLPanelDirBrowser::updateResultCount() | |||
203 | // add none found response | 208 | // add none found response |
204 | if (list->getItemCount() == 0) | 209 | if (list->getItemCount() == 0) |
205 | { | 210 | { |
206 | list->addCommentText(getFormattedUIString("not_found_text")); | 211 | list->addCommentText(getString("not_found_text")); |
207 | list->operateOnAll(LLCtrlListInterface::OP_DESELECT); | 212 | list->operateOnAll(LLCtrlListInterface::OP_DESELECT); |
208 | } | 213 | } |
209 | } | 214 | } |
@@ -228,6 +233,44 @@ void LLPanelDirBrowser::onClickNext(void* data) | |||
228 | self->nextPage(); | 233 | self->nextPage(); |
229 | } | 234 | } |
230 | 235 | ||
236 | // static | ||
237 | const std::string LLPanelDirBrowser::filter_short_words( const std::string source_string, | ||
238 | int shortest_word_length, | ||
239 | bool& was_filtered ) | ||
240 | { | ||
241 | // degenerate case | ||
242 | if ( source_string.length() < 1 ) | ||
243 | return ""; | ||
244 | |||
245 | std::stringstream codec( source_string ); | ||
246 | std::string each_word; | ||
247 | std::vector< std::string > all_words; | ||
248 | |||
249 | while( codec >> each_word ) | ||
250 | all_words.push_back( each_word ); | ||
251 | |||
252 | std::ostringstream dest_string( "" ); | ||
253 | |||
254 | was_filtered = false; | ||
255 | |||
256 | std::vector< std::string >::iterator iter = all_words.begin(); | ||
257 | while( iter != all_words.end() ) | ||
258 | { | ||
259 | if ( (int)(*iter).length() >= shortest_word_length ) | ||
260 | { | ||
261 | dest_string << *iter; | ||
262 | dest_string << " "; | ||
263 | } | ||
264 | else | ||
265 | { | ||
266 | was_filtered = true; | ||
267 | } | ||
268 | |||
269 | ++iter; | ||
270 | }; | ||
271 | |||
272 | return dest_string.str(); | ||
273 | } | ||
231 | 274 | ||
232 | void LLPanelDirBrowser::selectByUUID(const LLUUID& id) | 275 | void LLPanelDirBrowser::selectByUUID(const LLUUID& id) |
233 | { | 276 | { |
@@ -1170,7 +1213,7 @@ void LLPanelDirBrowser::setupNewSearch() | |||
1170 | 1213 | ||
1171 | // ready the list for results | 1214 | // ready the list for results |
1172 | list->operateOnAll(LLCtrlListInterface::OP_DELETE); | 1215 | list->operateOnAll(LLCtrlListInterface::OP_DELETE); |
1173 | list->addCommentText(getFormattedUIString("searching_text")); | 1216 | list->addCommentText(getString("searching_text")); |
1174 | childDisable("results"); | 1217 | childDisable("results"); |
1175 | 1218 | ||
1176 | mResultsReceived = 0; | 1219 | mResultsReceived = 0; |