From 51915686fd6b54c457229b9cbfbf8d91eaa3d08d Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Tue, 9 Dec 2008 20:34:38 -0600
Subject: Updated Inventory window filter text generation.

It was putting the wrong types in the title when filtering. [#25]
---
 linden/indra/newview/llfolderview.cpp | 38 +++++++++++++++++++++++------------
 linden/indra/newview/llfolderview.h   |  2 +-
 2 files changed, 26 insertions(+), 14 deletions(-)

(limited to 'linden/indra')

diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp
index 3f36222..2c5be34 100644
--- a/linden/indra/newview/llfolderview.cpp
+++ b/linden/indra/newview/llfolderview.cpp
@@ -4800,9 +4800,9 @@ void LLInventoryFilter::setModified(EFilterBehavior behavior)
 	}
 }
 
-BOOL LLInventoryFilter::isFilterWith(LLInventoryType::EType t)
+BOOL LLInventoryFilter::isFilterWith(LLInventoryType::NType t)
 {
-	return mFilterOps.mFilterTypes & (0x01 << t);
+	return mFilterOps.mFilterTypes & t;
 }
 
 std::string LLInventoryFilter::getFilterText()
@@ -4820,7 +4820,7 @@ std::string LLInventoryFilter::getFilterText()
 	S32 num_filter_types = 0;
 	mFilterText.clear();
 
-	if (isFilterWith(LLInventoryType::IT_ANIMATION))
+	if (isFilterWith(LLInventoryType::NIT_ANIMATION))
 	{
 		filtered_types += " Animations,";
 		filtered_by_type = TRUE;
@@ -4832,7 +4832,19 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 
-	if (isFilterWith(LLInventoryType::IT_CALLINGCARD))
+	if (isFilterWith(LLInventoryType::NIT_BODYPART))
+	{
+		filtered_types += " Body Parts,";
+		filtered_by_type = TRUE;
+		num_filter_types++;
+	}
+	else
+	{
+		not_filtered_types += " Body Parts,";
+		filtered_by_all_types = FALSE;
+	}
+
+	if (isFilterWith(LLInventoryType::NIT_CALLCARD))
 	{
 		filtered_types += " Calling Cards,";
 		filtered_by_type = TRUE;
@@ -4844,7 +4856,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 
-	if (isFilterWith(LLInventoryType::IT_WEARABLE))
+	if (isFilterWith(LLInventoryType::NIT_CLOTHING))
 	{
 		filtered_types += " Clothing,";
 		filtered_by_type = TRUE;
@@ -4856,7 +4868,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 
-	if (isFilterWith(LLInventoryType::IT_GESTURE))
+	if (isFilterWith(LLInventoryType::NIT_GESTURE))
 	{
 		filtered_types += " Gestures,";
 		filtered_by_type = TRUE;
@@ -4868,7 +4880,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 
-	if (isFilterWith(LLInventoryType::IT_LANDMARK))
+	if (isFilterWith(LLInventoryType::NIT_LANDMARK))
 	{
 		filtered_types += " Landmarks,";
 		filtered_by_type = TRUE;
@@ -4880,7 +4892,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 
-	if (isFilterWith(LLInventoryType::IT_NOTECARD))
+	if (isFilterWith(LLInventoryType::NIT_NOTECARD))
 	{
 		filtered_types += " Notecards,";
 		filtered_by_type = TRUE;
@@ -4892,7 +4904,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 	
-	if (isFilterWith(LLInventoryType::IT_OBJECT) && isFilterWith(LLInventoryType::IT_ATTACHMENT))
+	if (isFilterWith(LLInventoryType::NIT_OBJECT))
 	{
 		filtered_types += " Objects,";
 		filtered_by_type = TRUE;
@@ -4904,7 +4916,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 	
-	if (isFilterWith(LLInventoryType::IT_LSL))
+	if (isFilterWith(LLInventoryType::NIT_SCRIPT_LSL2))
 	{
 		filtered_types += " Scripts,";
 		filtered_by_type = TRUE;
@@ -4916,7 +4928,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 	
-	if (isFilterWith(LLInventoryType::IT_SOUND))
+	if (isFilterWith(LLInventoryType::NIT_SOUND))
 	{
 		filtered_types += " Sounds,";
 		filtered_by_type = TRUE;
@@ -4928,7 +4940,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 
-	if (isFilterWith(LLInventoryType::IT_TEXTURE))
+	if (isFilterWith(LLInventoryType::NIT_TEXTURE))
 	{
 		filtered_types += " Textures,";
 		filtered_by_type = TRUE;
@@ -4940,7 +4952,7 @@ std::string LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 
-	if (isFilterWith(LLInventoryType::IT_SNAPSHOT))
+	if (isFilterWith(LLInventoryType::NIT_SNAPSHOT))
 	{
 		filtered_types += " Snapshots,";
 		filtered_by_type = TRUE;
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h
index 324a15b..9134e0e 100644
--- a/linden/indra/newview/llfolderview.h
+++ b/linden/indra/newview/llfolderview.h
@@ -230,7 +230,7 @@ public:
 	void markDefault();
 	void resetDefault();
 
-	BOOL isFilterWith(LLInventoryType::EType t);
+	BOOL isFilterWith(LLInventoryType::NType t);
 
 	S32 getCurrentGeneration() const { return mFilterGeneration; }
 	S32 getMinRequiredGeneration() const { return mMinRequiredGeneration; }
-- 
cgit v1.1