From 64b192ed6274349a4b8844a9e0165e8b25f3a6ad Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 3 May 2011 13:18:16 -0700 Subject: EXP-756 : Fix inventory folder ordering on launch --- indra/newview/llpanelmaininventory.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 90617b7dc7..b9a6938492 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -192,6 +192,16 @@ BOOL LLPanelMainInventory::postBuild() mMenuAdd->getChild("Upload Animation")->setLabelArg("[COST]", upload_cost); mMenuAdd->getChild("Bulk Upload")->setLabelArg("[COST]", upload_cost); + // EXP-756: Force resorting of the list: in the case of date sorting, one didn't have enough information at + // the beginning to correctly sort the folders. Later resort didn't do anything as the order value was + // set correctly. The workaround is to reset the order to alphabetical (or anything) then to the correct order. + if (mActivePanel) + { + U32 order = mActivePanel->getSortOrder(); + mActivePanel->setSortOrder(LLInventoryFilter::SO_NAME); + mActivePanel->setSortOrder(order); + } + return TRUE; } -- cgit v1.2.3 From 45145fe7e2b6855b08b2ab94f07e852ef7ffffa3 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 3 May 2011 17:34:53 -0700 Subject: EXP-756 : Move the folder resort to first draw and do it only once --- indra/newview/llpanelmaininventory.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index b9a6938492..f79a1bb5ab 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -139,6 +139,7 @@ BOOL LLPanelMainInventory::postBuild() mActivePanel->getFilter()->markDefault(); mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); mActivePanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mActivePanel, _1, _2)); + mResortActivePanel = true; } LLInventoryPanel* recent_items_panel = getChild("Recent Items"); if (recent_items_panel) @@ -192,16 +193,6 @@ BOOL LLPanelMainInventory::postBuild() mMenuAdd->getChild("Upload Animation")->setLabelArg("[COST]", upload_cost); mMenuAdd->getChild("Bulk Upload")->setLabelArg("[COST]", upload_cost); - // EXP-756: Force resorting of the list: in the case of date sorting, one didn't have enough information at - // the beginning to correctly sort the folders. Later resort didn't do anything as the order value was - // set correctly. The workaround is to reset the order to alphabetical (or anything) then to the correct order. - if (mActivePanel) - { - U32 order = mActivePanel->getSortOrder(); - mActivePanel->setSortOrder(LLInventoryFilter::SO_NAME); - mActivePanel->setSortOrder(order); - } - return TRUE; } @@ -538,6 +529,17 @@ void LLPanelMainInventory::draw() { mFilterEditor->setText(mFilterSubString); } + if (mActivePanel && mResortActivePanel) + { + // EXP-756: Force resorting of the list the first time we draw the list: + // In the case of date sorting, we don't have enough information at initialization time + // to correctly sort the folders. Later manual resort doesn't do anything as the order value is + // set correctly. The workaround is to reset the order to alphabetical (or anything) then to the correct order. + U32 order = mActivePanel->getSortOrder(); + mActivePanel->setSortOrder(LLInventoryFilter::SO_NAME); + mActivePanel->setSortOrder(order); + mResortActivePanel = false; + } LLPanel::draw(); updateItemcountText(); } -- cgit v1.2.3