All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

STORM-316 Add missing "sort by name" and "sort by recent" options for folders

Review Request #27 - Created Dec. 16, 2010 and submitted

Kitty Barnett Reviewers
viewer
STORM-316
None viewer-development
Changes the UI (and needs additional translation), but it's a viewer 1 option that was missed by STORM-316.

Existing "Sort by (Name|Most Recent)" => "Sort Items by (Name|Most Recent)"

Split "Folders always by name" in two options to match what was done for inventory items and added "Sort Folders by (Name|Most Recent)" menu options.

 
Posted (Dec. 16, 2010, 2:06 p.m.)
For me 'Sort Folders by Most Recent' works only when 'Sort Items by Most Recent' is checked. Though I can't figure out what's wrong with this patch.
  1. I'm seeing it too...
    
    I *think* (part of) the cause may be in LLFolderViewFolder::sortBy(U32 order):
    
    	if (order & LLInventoryFilter::SO_DATE)
    	{
    		time_t latest = 0;
    
    		if (!mItems.empty())
    		{
    			LLFolderViewItem* item = *(mItems.begin());
    			latest = item->getCreationDate();
    		}
    
    		if (!mFolders.empty())
    		{
    			LLFolderViewFolder* folder = *(mFolders.begin());
    			if (folder->getCreationDate() > latest)
    			{
    				latest = folder->getCreationDate();
    			}
    		}
    		mSubtreeCreationDate = latest;
    	}
    
    It looks like in the case of a folder the creation date is always mSubtreeCreationDate and if the items aren't sorted by date, then mSubtreeCreationDate will never set for the folder.
    
    I'll peek at it some more over the weekend, thankies for the feedback, Seth :).