aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfolderview.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-11 16:33:01 -0700
committerMcCabe Maxsted2009-09-11 16:33:01 -0700
commit65e5463ae176dd148a4edcc45d0d4e1160cc6108 (patch)
tree17b1f1a1490c3f333170c0fabe51681a5b5ce812 /linden/indra/newview/llfolderview.cpp
parentFixed missing 'm' for draw distance slider (diff)
downloadmeta-impy-65e5463ae176dd148a4edcc45d0d4e1160cc6108.zip
meta-impy-65e5463ae176dd148a4edcc45d0d4e1160cc6108.tar.gz
meta-impy-65e5463ae176dd148a4edcc45d0d4e1160cc6108.tar.bz2
meta-impy-65e5463ae176dd148a4edcc45d0d4e1160cc6108.tar.xz
Applied inventory Search menu from Emerald viewer (still ugly)
Diffstat (limited to 'linden/indra/newview/llfolderview.cpp')
-rw-r--r--linden/indra/newview/llfolderview.cpp45
1 files changed, 43 insertions, 2 deletions
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp
index 70c4ead..5407f06 100644
--- a/linden/indra/newview/llfolderview.cpp
+++ b/linden/indra/newview/llfolderview.cpp
@@ -281,7 +281,28 @@ void LLFolderViewItem::refreshFromListener()
281{ 281{
282 if(mListener) 282 if(mListener)
283 { 283 {
284 //Super crazy hack to build the creator search label - RK
285 LLInventoryItem* item = gInventory.getItem(mListener->getUUID());
286 std::string creator_name;
287 if(item)
288 {
289 if(item->getCreatorUUID().notNull())
290 {
291 gCacheName->getFullName(item->getCreatorUUID(), creator_name);
292 }
293 }
294 mLabelCreator = creator_name;
295 /*if(creator_name == "(Loading...)")
296 mLabelCreator = "";
297 else
298 mLabelCreator = creator_name;*/
299
300 //Label for name search
284 mLabel = mListener->getDisplayName(); 301 mLabel = mListener->getDisplayName();
302
303 //Build label for combined search - RK
304 mLabelAll = mLabel + " " + mLabelCreator;
305
285 setIcon(mListener->getIcon()); 306 setIcon(mListener->getIcon());
286 time_t creation_date = mListener->getCreationDate(); 307 time_t creation_date = mListener->getCreationDate();
287 if (mCreationDate != creation_date) 308 if (mCreationDate != creation_date)
@@ -299,12 +320,26 @@ void LLFolderViewItem::refresh()
299 refreshFromListener(); 320 refreshFromListener();
300 321
301 std::string searchable_label(mLabel); 322 std::string searchable_label(mLabel);
323 std::string searchable_label_creator(mLabelCreator);
324 std::string searchable_label_all(mLabelAll);
325
326 //add the (no modify), (no transfer) etc stuff to each label.
302 searchable_label.append(mLabelSuffix); 327 searchable_label.append(mLabelSuffix);
328 searchable_label_creator.append(mLabelSuffix);
329 searchable_label_all.append(mLabelSuffix);
330
331 //all labels need to be uppercase.
303 LLStringUtil::toUpper(searchable_label); 332 LLStringUtil::toUpper(searchable_label);
333 LLStringUtil::toUpper(searchable_label_creator);
334 LLStringUtil::toUpper(searchable_label_all);
304 335
305 if (mSearchableLabel.compare(searchable_label)) 336 if (mSearchableLabel.compare(searchable_label) ||
337 mSearchableLabelCreator.compare(searchable_label_creator))
306 { 338 {
307 mSearchableLabel.assign(searchable_label); 339 mSearchableLabel.assign(searchable_label);
340 mSearchableLabelCreator.assign(searchable_label_creator);
341 mSearchableLabelAll.assign(searchable_label_all);
342
308 dirtyFilter(); 343 dirtyFilter();
309 // some part of label has changed, so overall width has potentially changed 344 // some part of label has changed, so overall width has potentially changed
310 if (mParentFolder) 345 if (mParentFolder)
@@ -588,7 +623,13 @@ void LLFolderViewItem::rename(const std::string& new_name)
588 623
589const std::string& LLFolderViewItem::getSearchableLabel() const 624const std::string& LLFolderViewItem::getSearchableLabel() const
590{ 625{
591 return mSearchableLabel; 626 U32 search_type = gSavedSettings.getU32("InventorySearchType");
627 if(search_type == 4)
628 return mSearchableLabelAll;
629 else if(search_type == 1)
630 return mSearchableLabelCreator;
631 else
632 return mSearchableLabel;
592} 633}
593 634
594const std::string& LLFolderViewItem::getName( void ) const 635const std::string& LLFolderViewItem::getName( void ) const