aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfolderview.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfolderview.cpp57
1 files changed, 46 insertions, 11 deletions
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp
index 5407f06..61d7df0 100644
--- a/linden/indra/newview/llfolderview.cpp
+++ b/linden/indra/newview/llfolderview.cpp
@@ -297,11 +297,22 @@ void LLFolderViewItem::refreshFromListener()
297 else 297 else
298 mLabelCreator = creator_name;*/ 298 mLabelCreator = creator_name;*/
299 299
300 //Label for desc search
301 std::string desc;
302 if(item)
303 {
304 if(!item->getDescription().empty())
305 {
306 desc = item->getDescription();
307 }
308 }
309 mLabelDesc = desc;
310
300 //Label for name search 311 //Label for name search
301 mLabel = mListener->getDisplayName(); 312 mLabel = mListener->getDisplayName();
302 313
303 //Build label for combined search - RK 314 //Build label for combined search - RK
304 mLabelAll = mLabel + " " + mLabelCreator; 315 mLabelAll = mLabel + " " + mLabelCreator + " " + mLabelDesc;
305 316
306 setIcon(mListener->getIcon()); 317 setIcon(mListener->getIcon());
307 time_t creation_date = mListener->getCreationDate(); 318 time_t creation_date = mListener->getCreationDate();
@@ -321,32 +332,53 @@ void LLFolderViewItem::refresh()
321 332
322 std::string searchable_label(mLabel); 333 std::string searchable_label(mLabel);
323 std::string searchable_label_creator(mLabelCreator); 334 std::string searchable_label_creator(mLabelCreator);
335 std::string searchable_label_desc(mLabelDesc);
324 std::string searchable_label_all(mLabelAll); 336 std::string searchable_label_all(mLabelAll);
325 337
326 //add the (no modify), (no transfer) etc stuff to each label. 338 //add the (no modify), (no transfer) etc stuff to each label.
327 searchable_label.append(mLabelSuffix); 339 searchable_label.append(mLabelSuffix);
328 searchable_label_creator.append(mLabelSuffix); 340 searchable_label_creator.append(mLabelSuffix);
341 searchable_label_desc.append(mLabelSuffix);
329 searchable_label_all.append(mLabelSuffix); 342 searchable_label_all.append(mLabelSuffix);
330 343
331 //all labels need to be uppercase. 344 //all labels need to be uppercase.
332 LLStringUtil::toUpper(searchable_label); 345 LLStringUtil::toUpper(searchable_label);
333 LLStringUtil::toUpper(searchable_label_creator); 346 LLStringUtil::toUpper(searchable_label_creator);
347 LLStringUtil::toUpper(searchable_label_desc);
334 LLStringUtil::toUpper(searchable_label_all); 348 LLStringUtil::toUpper(searchable_label_all);
335 349
336 if (mSearchableLabel.compare(searchable_label) || 350 if (mSearchableLabel.compare(searchable_label) ||
337 mSearchableLabelCreator.compare(searchable_label_creator)) 351 mSearchableLabelCreator.compare(searchable_label_creator) ||
352 mSearchableLabelDesc.compare(searchable_label_creator))
338 { 353 {
339 mSearchableLabel.assign(searchable_label); 354 mSearchableLabel.assign(searchable_label);
340 mSearchableLabelCreator.assign(searchable_label_creator); 355 mSearchableLabelCreator.assign(searchable_label_creator);
356 mSearchableLabelDesc.assign(searchable_label_desc);
341 mSearchableLabelAll.assign(searchable_label_all); 357 mSearchableLabelAll.assign(searchable_label_all);
342 358
343 dirtyFilter(); 359 dirtyFilter();
344 // some part of label has changed, so overall width has potentially changed 360 //some part of label has changed, so overall width has potentially changed
345 if (mParentFolder) 361 if (mParentFolder)
346 {
347 mParentFolder->requestArrange(); 362 mParentFolder->requestArrange();
348 }
349 } 363 }
364
365 /*if(mSearchableLabelCreator.compare(searchable_label_creator))
366 {
367 mSearchableLabelCreator.assign(searchable_label_creator);
368
369 dirtyFilter();
370 if(mParentFolder)
371 mParentFolder->requestArrange();
372 }
373
374 if(mSearchableLabelDesc.compare(searchable_label_desc))
375 {
376 mSearchableLabelDesc.assign(searchable_label_desc);
377
378 dirtyFilter();
379 if(mParentFolder)
380 mParentFolder->requestArrange();
381 }*/
350 382
351 S32 label_width = sFont->getWidth(mLabel); 383 S32 label_width = sFont->getWidth(mLabel);
352 if( mLabelSuffix.size() ) 384 if( mLabelSuffix.size() )
@@ -621,11 +653,12 @@ void LLFolderViewItem::rename(const std::string& new_name)
621 } 653 }
622} 654}
623 655
624const std::string& LLFolderViewItem::getSearchableLabel() const 656const std::string& LLFolderViewItem::getSearchableLabel(U32 search_type = 0) const
625{ 657{
626 U32 search_type = gSavedSettings.getU32("InventorySearchType"); 658 if(search_type == 3)
627 if(search_type == 4)
628 return mSearchableLabelAll; 659 return mSearchableLabelAll;
660 else if(search_type == 2)
661 return mSearchableLabelDesc;
629 else if(search_type == 1) 662 else if(search_type == 1)
630 return mSearchableLabelCreator; 663 return mSearchableLabelCreator;
631 else 664 else
@@ -4564,11 +4597,13 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item)
4564 } 4597 }
4565 LLFolderViewEventListener* listener = item->getListener(); 4598 LLFolderViewEventListener* listener = item->getListener();
4566 const LLUUID& item_id = listener->getUUID(); 4599 const LLUUID& item_id = listener->getUUID();
4567 mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; 4600
4601 U32 search_type = gSavedSettings.getU32("InventorySearchType");
4602 mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel(search_type).find(mFilterSubString) : std::string::npos;
4568 BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE) 4603 BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE)
4569 && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) 4604 && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos)
4570 && (mFilterWorn == false || gAgent.isWearingItem(item_id) || 4605 && (mFilterWorn == false || gAgent.isWearingItem(item_id) ||
4571 gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)) 4606 (gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)))
4572 && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) 4607 && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions)
4573 && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); 4608 && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate);
4574 return passed; 4609 return passed;