diff options
author | Kelly Washington <kelly@lindenlab.com> | 2012-11-12 14:11:16 -0800 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2012-11-12 14:11:16 -0800 |
commit | 92fb2eb11681a1c1eeef2adc4517cebbd4418e13 (patch) | |
tree | 97cb7ff8ab740cd584811717b5e9164b8ffb75f7 /indra | |
parent | 5646e564e5460db359f0b6641dc86d09b449ce3c (diff) |
MAINT-1897 Poor performance viewing large group member lists
* Clean up 'is group' extra data in namelists.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llnamelistctrl.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llnamelistctrl.h | 14 |
2 files changed, 18 insertions, 15 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 472c26e22d..29e7f00a87 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -204,7 +204,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; S32 column_index = getColumnIndexFromOffset(x); - LLScrollListItem* hit_item = hitItem(x, y); + LLNameListItem* hit_item = dynamic_cast<LLNameListItem*>(hitItem(x, y)); if (hit_item && column_index == mNameColumnIndex) { @@ -228,7 +228,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) LLCoordGL pos( sticky_rect.mRight - info_icon_size, sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight())/2 ); // Should we show a group or an avatar inspector? - bool is_group = hit_item->getValue()["is_group"].asBoolean(); + bool is_group = hit_item->isGroup(); LLToolTip::Params params; params.background_visible( false ); @@ -293,19 +293,12 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( const std::string& suffix) { LLUUID id = name_item.value().asUUID(); - LLNameListItem* item = NULL; - - // Store item type so that we can invoke the proper inspector. - // *TODO Vadim: Is there a more proper way of storing additional item data? - { - LLNameListCtrl::NameItem item_p(name_item); - item_p.value = LLSD().with("uuid", id).with("is_group", name_item.target() == GROUP); - item = new LLNameListItem(item_p); - LLScrollListCtrl::addRow(item, item_p, pos); - } + LLNameListItem* item = new LLNameListItem(name_item,name_item.target() == GROUP); if (!item) return NULL; + LLScrollListCtrl::addRow(item, name_item, pos); + // use supplied name by default std::string fullname = name_item.name; switch(name_item.target) @@ -411,7 +404,7 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, setNeedsSort(); } } - + dirtyColumns(); } diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index ba85e77c65..ec29bd0ad4 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -42,14 +42,24 @@ class LLAvatarName; class LLNameListItem : public LLScrollListItem, public LLHandleProvider<LLNameListItem> { public: - LLUUID getUUID() const { return getValue()["uuid"].asUUID(); } + bool isGroup() const { return mIsGroup; } + void setIsGroup(bool is_group) { mIsGroup = is_group; } + protected: friend class LLNameListCtrl; LLNameListItem( const LLScrollListItem::Params& p ) - : LLScrollListItem(p) + : LLScrollListItem(p), mIsGroup(false) + { + } + + LLNameListItem( const LLScrollListItem::Params& p, bool is_group ) + : LLScrollListItem(p), mIsGroup(is_group) { } + +private: + bool mIsGroup; }; |