diff options
Diffstat (limited to 'indra/newview/llpanelmarketplaceinboxinventory.cpp')
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index b644f0e5cb..cc6bf509d3 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -163,5 +163,74 @@ void LLInboxFolderViewFolder::draw() LLFolderViewFolder::draw(); } +void LLInboxFolderViewFolder::updateFlag() const +{ + LLDate saved_freshness_date = LLDate(gSavedSettings.getString("InboxFreshnessDate")); + if (getCreationDate() > saved_freshness_date.secondsSinceEpoch()) + { + mFresh = true; + } +} + +void LLInboxFolderViewFolder::selectItem() +{ + mFresh = false; + LLFolderViewFolder::selectItem(); +} + +void LLInboxFolderViewFolder::toggleOpen() +{ + mFresh = false; + LLFolderViewFolder::toggleOpen(); +} + +void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const +{ + mCreationDate = creation_date_utc; + updateFlag(); +} + + +time_t LLInboxFolderViewFolder::getCreationDate() const +{ + // 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) + { + LLFolderViewItem* itemp = (*iit); + + const time_t item_creation_date = itemp->getCreationDate(); + + if (item_creation_date) + { + mCreationDate = item_creation_date; + updateFlag(); + 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; + updateFlag(); + break; + } + } + } + } + + return llmax<time_t>(mCreationDate, mSubtreeCreationDate); +} // eof |