diff options
author | leyla <leyla@leyla.com> | 2011-06-10 15:14:18 -0700 |
---|---|---|
committer | leyla <leyla@leyla.com> | 2011-06-10 15:14:18 -0700 |
commit | 7ed78f92747a7234435d1b6ceef50a3053003f48 (patch) | |
tree | ddb99edc2232c7d4e1fba0b6e5f0ccaa7e009eea | |
parent | def85f2778d9b69bc3fb0e89c1cef854a1c01886 (diff) |
fixing folder sorting, folders don't have a date stamp so use first item's date
-rw-r--r-- | indra/newview/llfolderviewitem.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llfolderviewitem.h | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index d2bbfa2c2b..57e5488a4e 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -2334,6 +2334,21 @@ void LLFolderViewFolder::draw() time_t LLFolderViewFolder::getCreationDate() const { + // folders have no creation date so use first non-folder descendent's date + if (!mCreationDate) + { + for(items_t::const_iterator iit = mItems.begin(); + iit != mItems.end(); ++iit) + { + LLFolderViewItem* itemp = (*iit); + if (itemp->getCreationDate()) + { + mCreationDate = itemp->getCreationDate(); + break; + } + } + } + return llmax<time_t>(mCreationDate, mSubtreeCreationDate); } diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index fc941510ab..dbd7d5a370 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -135,7 +135,7 @@ protected: std::string mSearchableLabel; S32 mLabelWidth; bool mLabelWidthDirty; - time_t mCreationDate; + mutable time_t mCreationDate; LLFolderViewFolder* mParentFolder; LLFolderViewEventListener* mListener; BOOL mIsCurSelection; @@ -278,7 +278,7 @@ public: // Used for sorting, like getLabel() above. virtual time_t getCreationDate() const { return mCreationDate; } - + LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; } const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; } |