summaryrefslogtreecommitdiff
path: root/indra/newview/llfolderviewitem.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/llfolderviewitem.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/llfolderviewitem.cpp')
-rw-r--r--indra/newview/llfolderviewitem.cpp62
1 files changed, 23 insertions, 39 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 72e2294196..00bc63326b 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -2057,23 +2057,42 @@ BOOL LLFolderViewFolder::isRemovable()
BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item)
{
mItems.push_back(item);
+
if (item->isSelected())
{
recursiveIncrementNumDescendantsSelected(1);
}
+
item->setRect(LLRect(0, 0, getRect().getWidth(), 0));
item->setVisible(FALSE);
- addChild( item );
+
+ addChild(item);
+
item->dirtyFilter();
+
+ // Update the folder creation date if the child is newer than our current date
+ setCreationDate(llmax<time_t>(mCreationDate, item->getCreationDate()));
+
+ // Handle sorting
requestArrange();
requestSort();
+
+ // Traverse parent folders and update creation date and resort, if necessary
LLFolderViewFolder* parentp = getParentFolder();
- while (parentp && parentp->mSortFunction.isByDate())
+ while (parentp)
{
- // parent folder doesn't have a time stamp yet, so get it from us
- parentp->requestSort();
+ // Update the folder creation date if the child is newer than our current date
+ parentp->setCreationDate(llmax<time_t>(parentp->mCreationDate, item->getCreationDate()));
+
+ if (parentp->mSortFunction.isByDate())
+ {
+ // parent folder doesn't have a time stamp yet, so get it from us
+ parentp->requestSort();
+ }
+
parentp = parentp->getParentFolder();
}
+
return TRUE;
}
@@ -2437,41 +2456,6 @@ void LLFolderViewFolder::draw()
time_t LLFolderViewFolder::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)
- {
- setCreationDate(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)
- {
- setCreationDate(folder_creation_date);
- break;
- }
- }
- }
- }
-
return llmax<time_t>(mCreationDate, mSubtreeCreationDate);
}