summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-06-28 23:30:36 -0700
committerRichard Linden <none@none>2012-06-28 23:30:36 -0700
commit604bbb22783d2460384e340592ca1781908f6dd8 (patch)
tree42afa4894daf9a09e3935e32885c42f83f508162 /indra
parented7173c987cf4a5de2f3c9b9d792e5ac4006e833 (diff)
CHUI-101 WIP Make LLFolderview general purpose
cleaned up ownership of viewmodel more filtering fixes
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfolderview.h1
-rw-r--r--indra/newview/llfolderviewitem.h1
-rw-r--r--indra/newview/llinventoryfilter.cpp17
-rw-r--r--indra/newview/llpanelmaininventory.cpp24
-rw-r--r--indra/newview/llpanelobjectinventory.cpp2
-rw-r--r--indra/newview/llpanelobjectinventory.h2
6 files changed, 22 insertions, 25 deletions
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index d261a5967d..8a0317f840 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -302,7 +302,6 @@ protected:
LLFrameTimer mAutoOpenTimer;
LLFrameTimer mSearchTimer;
std::string mSearchString;
- LLFolderViewFilter* mFilter;
BOOL mShowSelectionContext;
BOOL mShowSingleSelection;
LLFrameTimer mMultiSelectionFadeTimer;
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 7e48969826..a3c92a55e8 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -281,7 +281,6 @@ protected:
S32 mLastCalculatedWidth;
S32 mMostFilteredDescendantGeneration;
bool mNeedsSort;
- bool mPassedFolderFilter;
public:
typedef enum e_recurse_type
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index c7e0136368..08f1e541b5 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -95,16 +95,13 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
return passed_clipboard;
}
- std::string::size_type string_offset = mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) : std::string::npos;
+ std::string::size_type string_offset = mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) : 0;
- const BOOL passed_filtertype = checkAgainstFilterType(listener);
- const BOOL passed_permissions = checkAgainstPermissions(listener);
- const BOOL passed_filterlink = checkAgainstFilterLinks(listener);
- const BOOL passed = (passed_filtertype &&
- passed_permissions &&
- passed_filterlink &&
- passed_clipboard &&
- (mFilterSubString.size() == 0 || string_offset != std::string::npos));
+ BOOL passed = string_offset != std::string::npos;
+ passed = passed && checkAgainstFilterType(listener);
+ passed = passed && checkAgainstPermissions(listener);
+ passed = passed && checkAgainstFilterLinks(listener);
+ passed = passed && passed_clipboard;
return passed;
}
@@ -595,7 +592,7 @@ void LLInventoryFilter::setDateRange(time_t min_date, time_t max_date)
void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl)
{
- static LLCachedControl<U32> s_last_logoff(gSavedSettings, "LastLogoff", 0);
+ static LLCachedControl<U32> s_last_logoff(gSavedPerAccountSettings, "LastLogoff", 0);
if (sl && !isSinceLogoff())
{
setDateRange(s_last_logoff(), time_max());
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 33581160fd..6cef1f877b 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -222,21 +222,21 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
if (p.validateBlock(false))
{
LLParamSDParser().writeSD(filterState, p);
- filterRoot[filter->getName()] = filterState;
+ filterRoot[filter->getName()] = filterState;
+ }
}
}
- }
- LLInventoryFilter* filter = findChild<LLInventoryPanel>("Recent Items")->getFilter();
- if (filter)
- {
- LLSD filterState;
- LLInventoryFilter::Params p;
- filter->toParams(p);
- LLParamSDParser parser;
- parser.writeSD(filterState, p);
- filterRoot[filter->getName()] = filterState;
- }
+ LLInventoryFilter* filter = findChild<LLInventoryPanel>("Recent Items")->getFilter();
+ if (filter)
+ {
+ LLSD filterState;
+ LLInventoryFilter::Params p;
+ filter->toParams(p);
+ LLParamSDParser parser;
+ parser.writeSD(filterState, p);
+ filterRoot[filter->getName()] = filterState;
+ }
std::ostringstream filterSaveName;
filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME);
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 6a232a26f7..d0b9072ade 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1562,7 +1562,7 @@ void LLPanelObjectInventory::reset()
p.tool_tip= LLTrans::getString("PanelContentsTooltip");
p.listener = LLTaskInvFVBridge::createObjectBridge(this, NULL);
p.folder_indentation = -14; // subtract space normally reserved for folder expanders
- p.view_model = new LLFolderViewModelInventory();
+ p.view_model = &mInventoryViewModel;
mFolders = LLUICtrlFactory::create<LLFolderView>(p);
// this ensures that we never say "searching..." or "no items found"
//TODO RN: make this happen by manipulating filter object directly
diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h
index 607b705f7f..7e857f8b31 100644
--- a/indra/newview/llpanelobjectinventory.h
+++ b/indra/newview/llpanelobjectinventory.h
@@ -29,6 +29,7 @@
#include "llvoinventorylistener.h"
#include "llpanel.h"
+#include "llinventorypanel.h" // for LLFolderViewModelInventory
#include "llinventory.h"
@@ -94,6 +95,7 @@ private:
BOOL mHaveInventory;
BOOL mIsInventoryEmpty;
BOOL mInventoryNeedsUpdate;
+ LLFolderViewModelInventory mInventoryViewModel;
};
#endif // LL_LLPANELOBJECTINVENTORY_H