From 813bc232e7175ba3e20a70f16427d12c7681a996 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 9 Dec 2013 15:42:51 -0800 Subject: MAINT-3017 FIX Inventory filter for Recent tab does not persist between sessions as it used to. added names back to inventory filters, so they can be deserialized --- indra/llcommon/llinitparam.h | 32 ++++++++++++++--------------- indra/llui/llfolderview.cpp | 12 ++++++----- indra/llui/llfolderviewmodel.h | 33 +++++++++++++++++++----------- indra/newview/llconversationmodel.h | 3 +++ indra/newview/llfolderviewmodelinventory.h | 4 ++++ indra/newview/llinventorypanel.cpp | 3 ++- indra/newview/llpanelobjectinventory.cpp | 3 ++- 7 files changed, 55 insertions(+), 35 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 03ab0fb67f..4bad0062a7 100755 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -497,25 +497,25 @@ namespace LLInitParam virtual ~Parser(); template bool readValue(T& param, typename boost::disable_if >::type* dummy = 0) - { + { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) - { + { return found_it->second(*this, (void*)¶m); - } - - return false; } - + + return false; + } + template bool readValue(T& param, typename boost::enable_if >::type* dummy = 0) - { + { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) - { + { return found_it->second(*this, (void*)¶m); - } + } else - { + { found_it = mParserReadFuncs->find(&typeid(S32)); if (found_it != mParserReadFuncs->end()) { @@ -523,20 +523,20 @@ namespace LLInitParam bool parsed = found_it->second(*this, (void*)&int_value); param = (T)int_value; return parsed; - } } - return false; } + return false; + } template bool writeValue(const T& param, name_stack_t& name_stack) - { + { parser_write_func_map_t::iterator found_it = mParserWriteFuncs->find(&typeid(T)); if (found_it != mParserWriteFuncs->end()) - { + { return found_it->second(*this, (const void*)¶m, name_stack); - } - return false; } + return false; + } // dispatch inspection to registered inspection functions, for each parameter in a param block template bool inspectValue(name_stack_t& name_stack, S32 min_count, S32 max_count, const possible_values_t* possible_values) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index f32a52e6c6..884fd0ed0f 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1599,19 +1599,21 @@ void LLFolderView::update() // until that inventory is loaded up. LLFastTimer t2(FTM_INVENTORY); - if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) + LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter(); + + if (filter_object.isModified() && filter_object.isNotDefault()) { mNeedsAutoSelect = TRUE; } // Filter to determine visibility before arranging - filter(getFolderViewModel()->getFilter()); + filter(filter_object); // Clear the modified setting on the filter only if the filter finished after running the filter process // Note: if the filter count has timed out, that means the filter halted before completing the entire set of items - if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut())) + if (filter_object.isModified() && (!filter_object.isTimedOut())) { - getFolderViewModel()->getFilter().clearModified(); + filter_object.clearModified(); } // automatically show matching items, and select first one if we had a selection @@ -1630,7 +1632,7 @@ void LLFolderView::update() // Open filtered folders for folder views with mAutoSelectOverride=TRUE. // Used by LLPlacesFolderView. - if (getFolderViewModel()->getFilter().showAllResults()) + if (filter_object.showAllResults()) { // these are named variables to get around gcc not binding non-const references to rvalues // and functor application is inherently non-const to allow for stateful functors diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index b1bcc8bbb4..a909d13f97 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -386,27 +386,36 @@ template base_t; + LLConversationViewModel() + : base_t(new LLConversationSort(), new LLConversationFilter()) + {} void sort(LLFolderViewFolder* folder); bool contentsReady() { return true; } // *TODO : we need to check that participants names are available somewhat diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 9dcfdfa185..8772185ad0 100755 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -105,6 +105,10 @@ class LLFolderViewModelInventory public: typedef LLFolderViewModel base_t; + LLFolderViewModelInventory(const std::string& name) + : base_t(new LLInventorySort(), new LLInventoryFilter(LLInventoryFilter::Params().name(name))) + {} + void setTaskID(const LLUUID& id) {mTaskID = id;} void sort(LLFolderViewFolder* folder); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index e5b9e11d48..d27f7d2527 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -146,7 +146,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mShowItemLinkOverlays(p.show_item_link_overlays), mShowEmptyMessage(p.show_empty_message), mViewsInitialized(false), - mInvFVBridgeBuilder(NULL) + mInvFVBridgeBuilder(NULL), + mInventoryViewModel(p.name) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index d7130820ab..bb063f48a5 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1491,7 +1491,8 @@ LLPanelObjectInventory::LLPanelObjectInventory(const LLPanelObjectInventory::Par mFolders(NULL), mHaveInventory(FALSE), mIsInventoryEmpty(TRUE), - mInventoryNeedsUpdate(FALSE) + mInventoryNeedsUpdate(FALSE), + mInventoryViewModel(p.name) { // Setup context menu callbacks mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelObjectInventory::doToSelected, this, _2)); -- cgit v1.2.3