diff options
author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-04-22 15:48:48 +0300 |
---|---|---|
committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-04-22 15:48:48 +0300 |
commit | b15e2beabfc2987ba8d17b74014074ba313b5db7 (patch) | |
tree | 23b42e9544f052b5974244d71377a7550c55db83 /indra/newview/llinventoryitemslist.h | |
parent | 29801ac52b3df201535c8e96b4cfc80e38a619f8 (diff) |
Implemented EXT-6724(normal task) - Implement flat list view of filtered inventory for "add wearables" panel of outfit editor
1. Modified LLInventoryItemsList - implemented delayed item construction. Items are added during draw, not more than 50 items will be added in single draw. This lets us reduce system overload during multiple panel construction.
2. Implemented LLFilteredWearableListManager to populate inventory flat list with data. This class filters entire inventory according to specified filter and populates specified inventory list with data.
3. Created LLCommonUtil::computeDifference() to avoid code copy-pasting(will use it in all appropriate places in next review request)
Reviewed by Mike Antipov - https://codereview.productengine.com/secondlife/r/301/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llinventoryitemslist.h')
-rw-r--r-- | indra/newview/llinventoryitemslist.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index bba739dbbf..0ca4146867 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -80,9 +80,43 @@ public: void refreshList(const LLInventoryModel::item_array_t item_array); + /** + * Let list know items need to be refreshed in next draw() + */ + void setNeedsRefresh(bool needs_refresh){ mNeedsRefresh = needs_refresh; } + + bool getNeedsRefresh(){ return mNeedsRefresh; } + + /*virtual*/ void draw(); + protected: friend class LLUICtrlFactory; LLInventoryItemsList(const LLFlatListView::Params& p); + + uuid_vec_t& getIDs() { return mIDs; } + + /** + * Refreshes list items, adds new items and removes deleted items. + * Called from draw() until all new items are added, , + * maximum 50 items can be added during single call. + */ + void refresh(); + + /** + * Compute difference between new items and current items, fills 'vadded' with added items, + * 'vremoved' with removed items. See LLCommonUtils::computeDifference + */ + void computeDifference(const uuid_vec_t& vnew, uuid_vec_t& vadded, uuid_vec_t& vremoved); + + /** + * Add an item to the list + */ + void addNewItem(LLViewerInventoryItem* item); + +private: + uuid_vec_t mIDs; // IDs of items that were added in refreshList(). + // Will be used in refresh() to determine added and removed ids + bool mNeedsRefresh; }; #endif //LL_LLINVENTORYITEMSLIST_H |