diff options
-rw-r--r-- | indra/newview/llfolderviewmodelinventory.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llfolderviewmodelinventory.h | 1 |
2 files changed, 15 insertions, 9 deletions
diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp index 117e2534cb..4544b083ed 100644 --- a/indra/newview/llfolderviewmodelinventory.cpp +++ b/indra/newview/llfolderviewmodelinventory.cpp @@ -140,15 +140,20 @@ void LLFolderViewModelItemInventory::requestSort() { folderp->requestArrange(); } - if (static_cast<LLFolderViewModelInventory&>(mRootViewModel).getSorter().isByDate()) - { - // sort by date potentially affects parent folders which use a date - // derived from newest item in them - if (mParent) - { - mParent->requestSort(); - } - } + LLInventorySort sorter = static_cast<LLFolderViewModelInventory&>(mRootViewModel).getSorter(); + + if (sorter.isByDate()) + { + // Sort by date potentially affects parent folders which use a date + // derived from newest item in them + // + // if this is an item, parent needs to be resorted (this case shouldn't happen) + // if this is a folder, check sort rules for folder first + if (mParent && (!folderp || !sorter.isFoldersByName())) + { + mParent->requestSort(); + } + } } void LLFolderViewModelItemInventory::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size) diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 06a908cccc..8ee3f75002 100644 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -82,6 +82,7 @@ public: } bool isByDate() const { return mByDate; } + bool isFoldersByName() const { return (!mByDate || mFoldersByName) && !mFoldersByWeight; } U32 getSortOrder() const { return mSortOrder; } void toParams(Params& p) { p.order(mSortOrder);} void fromParams(Params& p) |