diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfolderview.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llfolderview.h | 1 | ||||
-rw-r--r-- | indra/newview/llfolderviewitem.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llinventoryfilter.h | 11 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.h | 1 |
6 files changed, 21 insertions, 18 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index b3b1ce5743..3884b94b60 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -301,18 +301,6 @@ BOOL LLFolderView::canFocusChildren() const return FALSE; } -void LLFolderView::checkTreeResortForModelChanged() -{ - if (mSortOrder & LLInventoryFilter::SO_DATE && !(mSortOrder & LLInventoryFilter::SO_FOLDERS_BY_NAME)) - { - // This is the case where something got added or removed. If we are date sorting - // everything including folders, then we need to rebuild the whole tree. - // Just set to something not SO_DATE to force the folder most resent date resort. - mSortOrder = mSortOrder & ~LLInventoryFilter::SO_DATE; - setSortOrder(mSortOrder | LLInventoryFilter::SO_DATE); - } -} - static LLFastTimer::DeclareTimer FTM_SORT("Sort Inventory"); void LLFolderView::setSortOrder(U32 order) diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 210ba9eb3c..1464a058d8 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -101,7 +101,6 @@ public: // FolderViews default to sort by name. This will change that, // and resort the items if necessary. void setSortOrder(U32 order); - void checkTreeResortForModelChanged(); void setFilterPermMask(PermissionMask filter_perm_mask); void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; } diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 3c36248c1f..e9d1ad3a9e 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1835,7 +1835,7 @@ void LLFolderViewFolder::sortBy(U32 order) return; } - // Propegate this change to sub folders + // Propagate this change to sub folders for (folders_t::iterator iter = mFolders.begin(); iter != mFolders.end();) { diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index f488b2ed1b..39e6f797a2 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -66,10 +66,13 @@ public: FILTERLINK_ONLY_LINKS // only show links }; - // REFACTOR: Change this to an enum. - static const U32 SO_DATE = 1; - static const U32 SO_FOLDERS_BY_NAME = 2; - static const U32 SO_SYSTEM_FOLDERS_TO_TOP = 4; + enum ESortOrderType + { + SO_NAME = 0, // Sort inventory by name + SO_DATE = 0x1, // Sort inventory by date + SO_FOLDERS_BY_NAME = 0x1 << 1, // Force folder sort by name + SO_SYSTEM_FOLDERS_TO_TOP = 0x1 << 2 // Force system folders to be on top + }; LLInventoryFilter(const std::string& name); virtual ~LLInventoryFilter(); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 90617b7dc7..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<LLInventoryPanel>("Recent Items"); if (recent_items_panel) @@ -528,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(); } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index c2b78ff9ea..2b2ee1c0c9 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -121,6 +121,7 @@ private: LLTabContainer* mFilterTabs; LLHandle<LLFloater> mFinderHandle; LLInventoryPanel* mActivePanel; + bool mResortActivePanel; LLSaveFolderState* mSavedFolderState; std::string mFilterText; std::string mFilterSubString; |