diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-06-30 17:29:12 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-06-30 17:29:12 -0700 |
commit | 0382b8dcbfe53f226ebc4ee3779c855cc246becb (patch) | |
tree | 83d6b556eb087faa3af2e3a6666bded0522166ce /indra | |
parent | e175d3357ba684281296ffb86ecb5ece196d28e7 (diff) |
EXP-893 EXTRA -- Single order purchases not sorted with most recent item delivered at top of list
Fixed folder getCreationDate function to handle nested folders. This should allow
the inbox to properly date sort items delivered with nested folders.
Reviewed by Leyla.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfolderviewitem.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 1fb8c52068..b76e8395fb 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -2409,19 +2409,39 @@ void LLFolderViewFolder::draw() time_t LLFolderViewFolder::getCreationDate() const { - // folders have no creation date so use first non-folder descendent's date + // folders have no creation date try to create one from an item somewhere in our folder hierarchy if (!mCreationDate) { - for(items_t::const_iterator iit = mItems.begin(); - iit != mItems.end(); ++iit) + for (items_t::const_iterator iit = mItems.begin(); + iit != mItems.end(); ++iit) { LLFolderViewItem* itemp = (*iit); - if (itemp->getCreationDate()) + + const time_t item_creation_date = itemp->getCreationDate(); + + if (item_creation_date) { - mCreationDate = itemp->getCreationDate(); + mCreationDate = item_creation_date; break; } } + + if (!mCreationDate) + { + for (folders_t::const_iterator fit = mFolders.begin(); + fit != mFolders.end(); ++fit) + { + LLFolderViewFolder* folderp = (*fit); + + const time_t folder_creation_date = folderp->getCreationDate(); + + if (folder_creation_date) + { + mCreationDate = folder_creation_date; + break; + } + } + } } return llmax<time_t>(mCreationDate, mSubtreeCreationDate); |