EXT-4089 : InventorySP File->Open doesn't open folders.

Includes some minor const correctness infrastructure changes.
meow-7.2.2
Loren Shih 2010-01-08 12:34:10 -05:00
parent 6abd41831a
commit a2d4b740ed
4 changed files with 14 additions and 8 deletions

View File

@ -820,10 +820,11 @@ void LLFolderView::clearSelection()
mSelectThisID.setNull();
}
BOOL LLFolderView::getSelectionList(std::set<LLUUID> &selection)
BOOL LLFolderView::getSelectionList(std::set<LLUUID> &selection) const
{
selected_items_t::iterator item_it;
for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
for (selected_items_t::const_iterator item_it = mSelectedItems.begin();
item_it != mSelectedItems.end();
++item_it)
{
selection.insert((*item_it)->getListener()->getUUID());
}

View File

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

View File

@ -237,7 +237,7 @@ public:
virtual void recursiveDeselect(BOOL deselect_self);
// gets multiple-element selection
virtual BOOL getSelectionList(std::set<LLUUID> &selection){return TRUE;}
virtual BOOL getSelectionList(std::set<LLUUID> &selection) const {return TRUE;}
// Returns true is this object and all of its children can be removed (deleted by user)
virtual BOOL isRemovable();
@ -304,7 +304,7 @@ public:
// Show children (unfortunate that this is called "open")
virtual void setOpen(BOOL open = TRUE) {};
virtual BOOL isOpen() { return FALSE; }
virtual BOOL isOpen() const { return FALSE; }
virtual LLFolderView* getRoot();
BOOL isDescendantOf( const LLFolderViewFolder* potential_ancestor );
@ -499,7 +499,7 @@ public:
virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse = RECURSE_NO);
// Get the current state of the folder.
virtual BOOL isOpen() { return mIsOpen; }
virtual BOOL isOpen() const { return mIsOpen; }
// special case if an object is dropped on the child.
BOOL handleDragAndDropFromChild(MASK mask,

View File

@ -2074,7 +2074,12 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model
{
if ("open" == action)
{
openItem();
LLFolderViewFolder *f = dynamic_cast<LLFolderViewFolder *>(folder->getItemByID(mUUID));
if (f)
{
f->setOpen(TRUE);
}
return;
}
else if ("paste" == action)