Skip to content
Snippets Groups Projects
Commit d68f4ff6 authored by Merov Linden's avatar Merov Linden
Browse files

CHUI-659 : WIP : Reimplemented favorite landmark sorting to follow favorites bar index sorting.

parent 3d0ec3da
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "llinventorymodelbackgroundfetch.h" #include "llinventorymodelbackgroundfetch.h"
#include "llinventorypanel.h" #include "llinventorypanel.h"
#include "lltooldraganddrop.h" #include "lltooldraganddrop.h"
#include "llfavoritesbar.h"
// //
// class LLFolderViewModelInventory // class LLFolderViewModelInventory
...@@ -236,39 +237,31 @@ const LLFolderViewModelInventory* LLInventoryPanel::getFolderViewModel() const ...@@ -236,39 +237,31 @@ const LLFolderViewModelInventory* LLInventoryPanel::getFolderViewModel() const
bool LLInventorySort::operator()(const LLFolderViewModelItemInventory* const& a, const LLFolderViewModelItemInventory* const& b) const bool LLInventorySort::operator()(const LLFolderViewModelItemInventory* const& a, const LLFolderViewModelItemInventory* const& b) const
{ {
// ignore sort order for landmarks in the Favorites folder. // Ignore sort order for landmarks in the Favorites folder.
// they should be always sorted as in Favorites bar. See EXT-719 // In that folder, landmarks should be always sorted as in the Favorites bar. See EXT-719
//TODO RN: fix sorting in favorites folder if (a->getSortGroup() == SG_ITEM
//if (a->getSortGroup() == SG_ITEM && b->getSortGroup() == SG_ITEM
// && b->getSortGroup() == SG_ITEM && a->getInventoryType() == LLInventoryType::IT_LANDMARK
// && a->getInventoryType() == LLInventoryType::IT_LANDMARK && b->getInventoryType() == LLInventoryType::IT_LANDMARK)
// && b->getInventoryType() == LLInventoryType::IT_LANDMARK) {
//{ static const LLUUID& favorites_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
// If both landmarks are in the favorite folder...
// static const LLUUID& favorites_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); if (gInventory.isObjectDescendentOf(a->getUUID(), favorites_folder_id) && gInventory.isObjectDescendentOf(b->getUUID(), favorites_folder_id))
{
// LLUUID a_uuid = a->getParentFolder()->getUUID(); // Get their index in that folder
// LLUUID b_uuid = b->getParentFolder()->getUUID(); S32 a_sort = LLFavoritesOrderStorage::instance().getSortIndex(a->getUUID());
S32 b_sort = LLFavoritesOrderStorage::instance().getSortIndex(b->getUUID());
// if ((a_uuid == favorites_folder_id && b_uuid == favorites_folder_id)) // Note: since there are both in the favorite, we shouldn't get negative index value...
// { if (!((a_sort < 0) && (b_sort < 0)))
// // *TODO: mantipov: probably it is better to add an appropriate method to LLFolderViewItem {
// // or to LLInvFVBridge return a_sort < b_sort;
// LLViewerInventoryItem* aitem = (static_cast<const LLItemBridge*>(a))->getItem(); }
// LLViewerInventoryItem* bitem = (static_cast<const LLItemBridge*>(b))->getItem(); }
// if (!aitem || !bitem) }
// return false;
// S32 a_sort = aitem->getSortField();
// S32 b_sort = bitem->getSortField();
// return a_sort < b_sort;
// }
//}
// We sort by name if we aren't sorting by date // We sort by name if we aren't sorting by date
// OR if these are folders and we are sorting folders by name. // OR if these are folders and we are sorting folders by name.
bool by_name = (!mByDate bool by_name = (!mByDate || (mFoldersByName && (a->getSortGroup() != SG_ITEM)));
|| (mFoldersByName
&& (a->getSortGroup() != SG_ITEM)));
if (a->getSortGroup() != b->getSortGroup()) if (a->getSortGroup() != b->getSortGroup())
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment