diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.h | 1 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinbox.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.cpp | 39 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.h | 2 |
7 files changed, 39 insertions, 52 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 1c33c4489b..b172359851 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1487,26 +1487,9 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item) item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); item->setVisible(FALSE); - - - // TODO RN - port creation date management to new code location -#if 0 - // Update the folder creation date if the child is newer than our current date - setCreationDate(llmax<time_t>(mCreationDate, item->getCreationDate())); -#endif addChild(item); getViewModelItem()->addChild(item->getViewModelItem()); - // TODO RN - port creation date management to new code location -#if 0 - // Traverse parent folders and update creation date and resort, if necessary - LLFolderViewFolder* parentp = getParentFolder(); - while (parentp) - { - // Update the folder creation date if the child is newer than our current date - parentp->setCreationDate(llmax<time_t>(parentp->mCreationDate, item->getCreationDate())); - } -#endif //TODO RN - make sort bubble up as long as parent Folder doesn't have anything matching sort criteria //// Traverse parent folders and update creation date and resort, if necessary diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6c3aaf5eec..215a08b34a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3098,6 +3098,19 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re return FALSE; } +//Recursively update the folder's creation date +void LLFolderBridge::updateHierarchyCreationDate(time_t date) +{ + if(getCreationDate() < date) + { + setCreationDate(date); + if(mParent) + { + static_cast<LLFolderBridge *>(mParent)->updateHierarchyCreationDate(date); + } + } +} + void LLFolderBridge::pasteFromClipboard() { LLInventoryModel* model = getInventoryModel(); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index fc0b15acad..6beccf19ae 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -274,6 +274,7 @@ public: virtual BOOL removeItem(); BOOL removeSystemFolder(); bool removeItemResponse(const LLSD& notification, const LLSD& response); + void updateHierarchyCreationDate(time_t date); virtual void pasteFromClipboard(); virtual void pasteLinkFromClipboard(); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 82cb268e9e..22e6943f50 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -774,12 +774,13 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) } } - if (folder_view_item) - { - folder_view_item->addToFolder(parent_folder); + if (folder_view_item) + { + llassert(parent_folder != NULL); + folder_view_item->addToFolder(parent_folder); addItemID(id, folder_view_item); - } - } + } + } // If this is a folder, add the children of the folder and recursively add any // child folders. diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index ea0521e3a7..4a63585ed5 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -128,7 +128,6 @@ BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL dr U32 LLPanelMarketplaceInbox::getFreshItemCount() const { -#if SUPPORTING_FRESH_ITEM_COUNT // // NOTE: When turning this on, be sure to test the no inbox/outbox case because this code probably @@ -174,9 +173,6 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const } return fresh_item_count; -#else - return getTotalItemCount(); -#endif } U32 LLPanelMarketplaceInbox::getTotalItemCount() const @@ -231,7 +227,6 @@ void LLPanelMarketplaceInbox::draw() args["[NUM]"] = item_count_str; mInboxButton->setLabel(getString("InboxLabelWithArg", args)); -#if SUPPORTING_FRESH_ITEM_COUNT // set green text to fresh item count U32 fresh_item_count = getFreshItemCount(); mFreshCountCtrl->setVisible((fresh_item_count > 0)); @@ -240,9 +235,6 @@ void LLPanelMarketplaceInbox::draw() { mFreshCountCtrl->setTextArg("[NUM]", llformat("%d", fresh_item_count)); } -#else - mFreshCountCtrl->setVisible(FALSE); -#endif } else { diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 0d3fbe66d7..68aefa7fb7 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -95,22 +95,36 @@ LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) LLBadgeOwner(getHandle()), mFresh(false) { -#if SUPPORTING_FRESH_ITEM_COUNT initBadgeParams(p.new_badge()); -#endif +} + +void LLInboxFolderViewFolder::addItem(LLFolderViewItem* item) +{ + LLFolderViewFolder::addItem(item); + + if(item) + { + LLInvFVBridge* itemBridge = static_cast<LLInvFVBridge*>(item->getViewModelItem()); + LLFolderBridge * bridge = static_cast<LLFolderBridge *>(getViewModelItem()); + bridge->updateHierarchyCreationDate(itemBridge->getCreationDate()); + } + + // Compute freshness if our parent is the root folder for the inbox + if (mParentFolder == mRoot) + { + computeFreshness(); + } } // virtual void LLInboxFolderViewFolder::draw() { -#if SUPPORTING_FRESH_ITEM_COUNT if (!badgeHasParent()) { addBadgeToParentPanel(); } setBadgeVisibility(mFresh); -#endif LLFolderViewFolder::draw(); } @@ -157,17 +171,6 @@ void LLInboxFolderViewFolder::deFreshify() gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); } -// TODO RN: move this behavior to modelview? -//void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) -//{ -// mCreationDate = creation_date_utc; -// -// if (LLFolderViewItem::mParentFolder == mRoot) -// { -// computeFreshness(); -// } -//} - // // LLInboxFolderViewItem Implementation // @@ -177,22 +180,18 @@ LLInboxFolderViewItem::LLInboxFolderViewItem(const Params& p) , LLBadgeOwner(getHandle()) , mFresh(false) { -#if SUPPORTING_FRESH_ITEM_COUNT initBadgeParams(p.new_badge()); -#endif } void LLInboxFolderViewItem::addToFolder(LLFolderViewFolder* folder) { LLFolderViewItem::addToFolder(folder); -#if SUPPORTING_FRESH_ITEM_COUNT // Compute freshness if our parent is the root folder for the inbox if (mParentFolder == mRoot) { computeFreshness(); } -#endif } BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask) @@ -205,14 +204,12 @@ BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask) // virtual void LLInboxFolderViewItem::draw() { -#if SUPPORTING_FRESH_ITEM_COUNT if (!badgeHasParent()) { addBadgeToParentPanel(); } setBadgeVisibility(mFresh); -#endif LLFolderViewItem::draw(); } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 098969aca6..c05e18c300 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -33,7 +33,6 @@ #include "llfolderviewitem.h" -#define SUPPORTING_FRESH_ITEM_COUNT 1 @@ -66,6 +65,7 @@ public: LLInboxFolderViewFolder(const Params& p); + void addItem(LLFolderViewItem* item); void draw(); void selectItem(); |