diff options
Diffstat (limited to 'indra/newview/llfolderviewitem.cpp')
-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); |