summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmarketplaceinboxinventory.cpp
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-09-07 12:45:50 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-09-07 12:45:50 -0700
commit6bb2b2cb99740a00498f5441b8a48b0bf5a04985 (patch)
treebd5fcf721c618d5c778c58ec064a8bc23434869c /indra/newview/llpanelmarketplaceinboxinventory.cpp
parentb18390f0f8432029f4de31be912d77d527edc94e (diff)
EXP-1194 FIX -- Update New tag behavior to update Newness timestamp when Received Items panel is open and do not auto open Received Items panel
* Updated inbox freshness time setting name to "LastInventoryInboxActivity" * New time stamp reflects time of last activity performed on the inbox by the user * Selection and opening items in the inbox both count as activity on the inbox * Focus going to the inbox panel counts as activity on the inbox * Creation date of folders now computed based on date of items being added to them * Creation date of folders no longer relies on queries for creation date, as is done during sorting * Folders are assumed to be "new" if no inbox freshness time setting is saved
Diffstat (limited to 'indra/newview/llpanelmarketplaceinboxinventory.cpp')
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.cpp44
1 files changed, 27 insertions, 17 deletions
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index e5b0db92f3..47f34434db 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -37,6 +37,8 @@
#include "llviewerfoldertype.h"
+#define DEBUGGING_FRESHNESS 0
+
//
// statics
//
@@ -188,49 +190,57 @@ void LLInboxFolderViewFolder::draw()
LLFolderViewFolder::draw();
}
-BOOL LLInboxFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root)
-{
- BOOL retval = LLFolderViewFolder::addToFolder(folder, root);
-
- // Only mark top-level inbox folders as fresh
- mFresh = (mParentFolder == mRoot);
-
- return retval;
-}
-
-void LLInboxFolderViewFolder::updateFlag() const
+void LLInboxFolderViewFolder::computeFreshness()
{
- const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxExpansion");
+ const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxActivity");
if (!last_expansion.empty())
{
LLDate saved_freshness_date = LLDate(last_expansion);
mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch());
+
+#if DEBUGGING_FRESHNESS
+ if (mFresh)
+ {
+ llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << saved_freshness_date.secondsSinceEpoch() << llendl;
+ }
+#endif
+ }
+ else
+ {
+ mFresh = true;
}
}
+void LLInboxFolderViewFolder::deFreshify()
+{
+ mFresh = false;
+
+ gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
+}
+
void LLInboxFolderViewFolder::selectItem()
{
LLFolderViewFolder::selectItem();
- mFresh = false;
+ deFreshify();
}
void LLInboxFolderViewFolder::toggleOpen()
{
LLFolderViewFolder::toggleOpen();
- mFresh = false;
+ deFreshify();
}
-void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const
+void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
- if (mFresh)
+ if (mParentFolder == mRoot)
{
- updateFlag();
+ computeFreshness();
}
}