EXT-4088 : FIXED : INFRASTRUCTURE : Change LLFolderView::getSelectionList to return a selection

Function signature change to return a selection instead of taking one as an argument.
meow-7.2.2
Loren Shih 2010-05-13 16:53:29 -04:00
parent b0c2aebece
commit 1d6ebfbb57
11 changed files with 24 additions and 27 deletions

View File

@ -846,16 +846,16 @@ void LLFolderView::clearSelection()
mSelectThisID.setNull();
}
BOOL LLFolderView::getSelectionList(std::set<LLUUID> &selection) const
std::set<LLUUID> LLFolderView::getSelectionList() const
{
std::set<LLUUID> selection;
for (selected_items_t::const_iterator item_it = mSelectedItems.begin();
item_it != mSelectedItems.end();
++item_it)
{
selection.insert((*item_it)->getListener()->getUUID());
}
return (selection.size() != 0);
return selection;
}
BOOL LLFolderView::startDrag(LLToolDragAndDrop::ESource source)
@ -2070,8 +2070,7 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata)
}
std::set<LLUUID> selected_items;
getSelectionList(selected_items);
std::set<LLUUID> selected_items = getSelectionList();
LLMultiPreview* multi_previewp = NULL;
LLMultiProperties* multi_propertiesp = NULL;

View File

@ -164,7 +164,7 @@ public:
virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
virtual BOOL getSelectionList(std::set<LLUUID> &selection) const;
virtual std::set<LLUUID> getSelectionList() const;
// make sure if ancestor is selected, descendents are not
void sanitizeSelection();

View File

@ -387,6 +387,12 @@ void LLFolderViewItem::extendSelectionFromRoot(LLFolderViewItem* selection)
getRoot()->extendSelection(selection, NULL, selected_items);
}
std::set<LLUUID> LLFolderViewItem::getSelectionList() const
{
std::set<LLUUID> selection;
return selection;
}
EInventorySortGroup LLFolderViewItem::getSortGroup() const
{
return SG_ITEM;

View File

@ -231,7 +231,7 @@ public:
virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items){ return FALSE; }
// gets multiple-element selection
virtual BOOL getSelectionList(std::set<LLUUID> &selection) const {return TRUE;}
virtual std::set<LLUUID> getSelectionList() const;
// Returns true is this object and all of its children can be removed (deleted by user)
virtual BOOL isRemovable();

View File

@ -775,8 +775,7 @@ void LLInventoryPanel::doCreate(const LLSD& userdata)
bool LLInventoryPanel::beginIMSession()
{
std::set<LLUUID> selected_items;
mFolderRoot->getSelectionList(selected_items);
std::set<LLUUID> selected_items = mFolderRoot->getSelectionList();
std::string name;
static int session_num = 1;
@ -873,8 +872,7 @@ bool LLInventoryPanel::beginIMSession()
bool LLInventoryPanel::attachObject(const LLSD& userdata)
{
std::set<LLUUID> selected_items;
mFolderRoot->getSelectionList(selected_items);
std::set<LLUUID> selected_items = mFolderRoot->getSelectionList();
std::string joint_name = userdata.asString();
LLViewerJointAttachment* attachmentp = NULL;

View File

@ -993,8 +993,8 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
}
else if("create_pick" == command_name)
{
std::set<LLUUID> selection;
if ( mCurrentSelectedList && mCurrentSelectedList->getRootFolder()->getSelectionList(selection) )
std::set<LLUUID> selection = mCurrentSelectedList->getRootFolder()->getSelectionList();
if ( mCurrentSelectedList && !selection.empty() )
{
return ( 1 == selection.size() && !LLAgentPicksInfo::getInstance()->isPickLimitReached() );
}

View File

@ -1099,8 +1099,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
if (root)
{
can_delete = TRUE;
std::set<LLUUID> selection_set;
root->getSelectionList(selection_set);
std::set<LLUUID> selection_set = root->getSelectionList();
if (selection_set.empty()) return FALSE;
for (std::set<LLUUID>::iterator iter = selection_set.begin();
iter != selection_set.end();

View File

@ -1489,7 +1489,7 @@ void LLPanelObjectInventory::updateInventory()
BOOL inventory_has_focus = FALSE;
if (mHaveInventory)
{
mFolders->getSelectionList(selected_items);
selected_items = mFolders->getSelectionList();
inventory_has_focus = gFocusMgr.childHasKeyboardFocus(mFolders);
}

View File

@ -493,8 +493,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
LLFolderView* root = getActivePanel()->getRootFolder();
if (root)
{
std::set<LLUUID> selection_set;
root->getSelectionList(selection_set);
std::set<LLUUID> selection_set = root->getSelectionList();
can_delete = (selection_set.size() > 0);
for (std::set<LLUUID>::iterator iter = selection_set.begin();
iter != selection_set.end();
@ -515,8 +514,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
LLFolderView* root = getActivePanel()->getRootFolder();
if (root)
{
std::set<LLUUID> selection_set;
root->getSelectionList(selection_set);
std::set<LLUUID> selection_set = root->getSelectionList();
can_delete = (selection_set.size() > 0);
for (std::set<LLUUID>::iterator iter = selection_set.begin();
iter != selection_set.end();
@ -568,8 +566,7 @@ bool LLPanelOutfitsInventory::hasItemsSelected()
LLFolderView* root = getActivePanel()->getRootFolder();
if (root)
{
std::set<LLUUID> selection_set;
root->getSelectionList(selection_set);
std::set<LLUUID> selection_set = root->getSelectionList();
has_items_selected = (selection_set.size() > 0);
}
}

View File

@ -323,8 +323,7 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem()
U32 LLSidepanelInventory::getSelectedCount()
{
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
std::set<LLUUID> selection_list;
panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(selection_list);
std::set<LLUUID> selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList();
return selection_list.size();
}

View File

@ -796,7 +796,7 @@ private:
mSelectedItems.clear();
if (mActivePanel)
{
mActivePanel->getRootFolder()->getSelectionList(mSelectedItems);
mSelectedItems = mActivePanel->getRootFolder()->getSelectionList();
}
mSelectedItems.erase(mMoveIntoFolderID);
}
@ -829,8 +829,7 @@ private:
}
// get selected items (without destination folder)
selected_items_t selected_items;
mActivePanel->getRootFolder()->getSelectionList(selected_items);
selected_items_t selected_items = mActivePanel->getRootFolder()->getSelectionList();
selected_items.erase(mMoveIntoFolderID);
// compare stored & current sets of selected items