diff options
Diffstat (limited to 'indra/newview/llpanelmarketplaceinboxinventory.cpp')
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.cpp | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index b644f0e5cb..2c97d539a1 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -141,9 +141,11 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) : LLFolderViewFolder(p) , LLBadgeOwner(getHandle()) - , mFresh(false) + , mFresh(true) { +#if SUPPORTING_FRESH_ITEM_COUNT initBadgeParams(p.new_badge()); +#endif } LLInboxFolderViewFolder::~LLInboxFolderViewFolder() @@ -151,17 +153,56 @@ LLInboxFolderViewFolder::~LLInboxFolderViewFolder() } // virtual +time_t LLInboxFolderViewFolder::getCreationDate() const +{ + time_t ret_val = LLFolderViewFolder::getCreationDate(); + + if (!mCreationDate) + { + updateFlag(); + } + + return ret_val; +} + +// virtual void LLInboxFolderViewFolder::draw() { +#if SUPPORTING_FRESH_ITEM_COUNT if (!badgeHasParent()) { addBadgeToParentPanel(); } setBadgeVisibility(mFresh); +#endif LLFolderViewFolder::draw(); } +void LLInboxFolderViewFolder::updateFlag() const +{ + LLDate saved_freshness_date = LLDate(gSavedPerAccountSettings.getString("LastInventoryInboxExpand")); + mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); +} + +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(); +} + // eof |