Skip to content
Snippets Groups Projects
Commit 16773e00 authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

For EXT-4018: Wrong expansion behavior in inventory. Made process of finding...

For EXT-4018: Wrong expansion behavior in inventory.  Made process of finding the My Inventory folder more robust instead of assuming it was always the first child.
parent 3e6d795d
No related branches found
No related tags found
No related merge requests found
...@@ -433,11 +433,10 @@ void LLInventoryPanel::initializeViews() ...@@ -433,11 +433,10 @@ void LLInventoryPanel::initializeViews()
{ {
mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null);
} }
llinfos << this << " Generating views for start folder " << mStartFolderString << llendl;
rebuildViewsFor(mStartFolderID); rebuildViewsFor(mStartFolderID);
mViewsInitialized = true; mViewsInitialized = true;
defaultOpenInventory(); openStartFolderOrMyInventory();
} }
void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) void LLInventoryPanel::rebuildViewsFor(const LLUUID& id)
...@@ -575,7 +574,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) ...@@ -575,7 +574,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)
} }
// bit of a hack to make sure the inventory is open. // bit of a hack to make sure the inventory is open.
void LLInventoryPanel::defaultOpenInventory() void LLInventoryPanel::openStartFolderOrMyInventory()
{ {
if (mStartFolderString != "") if (mStartFolderString != "")
{ {
...@@ -583,13 +582,17 @@ void LLInventoryPanel::defaultOpenInventory() ...@@ -583,13 +582,17 @@ void LLInventoryPanel::defaultOpenInventory()
} }
else else
{ {
// Get the first child (it should be "My Inventory") and // Find My Inventory folder and open it up by name
// open it up by name (just to make sure the first child is actually a folder). for (LLView *child = mFolders->getFirstChild(); child; child = mFolders->findNextSibling(child))
LLView* first_child = mFolders->getFirstChild();
if (first_child)
{ {
const std::string& first_child_name = first_child->getName(); LLFolderViewFolder *fchild = dynamic_cast<LLFolderViewFolder*>(child);
mFolders->openFolder(first_child_name); if (fchild && fchild->getListener() &&
(fchild->getListener()->getUUID() == gInventory.getRootFolderID()))
{
const std::string& child_name = child->getName();
mFolders->openFolder(child_name);
break;
}
} }
} }
} }
......
...@@ -167,7 +167,7 @@ public: ...@@ -167,7 +167,7 @@ public:
static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE);
protected: protected:
void defaultOpenInventory(); // open the first level of inventory void openStartFolderOrMyInventory(); // open the first level of inventory
LLInventoryModel* mInventory; LLInventoryModel* mInventory;
LLInventoryObserver* mInventoryObserver; LLInventoryObserver* mInventoryObserver;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment