From a34c89df8724cc625b7e1383c12df43fc627d772 Mon Sep 17 00:00:00 2001 From: Loren Shih <seraph@lindenlab.com> Date: Tue, 17 Nov 2009 20:13:31 -0500 Subject: [PATCH] EXT-1916 : Landmarks are not sorted in the Favorites Bar accordion Sorting was fixed when LLFolderViewFolder was added back into the inventory panels. This checkin additionally allows sorting in the landmarks inventory panel. --- indra/llcommon/llfoldertype.cpp | 3 +++ indra/newview/llinventorybridge.cpp | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index 079e670b1ab..a5dd342be2f 100644 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -120,6 +120,8 @@ const std::string &LLFolderType::lookup(LLFolderType::EType folder_type) // you can't change certain properties such as their type. bool LLFolderType::lookupIsProtectedType(EType folder_type) { + return FALSE; + /* const LLFolderDictionary *dict = LLFolderDictionary::getInstance(); const FolderEntry *entry = dict->lookup(folder_type); if (entry) @@ -127,6 +129,7 @@ bool LLFolderType::lookupIsProtectedType(EType folder_type) return entry->mIsProtected; } return true; + */ } // static diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 2afe48bc8af..93da313f274 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2852,9 +2852,11 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } const LLUUID& favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE); - + const LLUUID& landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK); + const BOOL folder_allows_reorder = ((mUUID == landmarks_id) || (mUUID == favorites_id)); + // we can move item inside a folder only if this folder is Favorites. See EXT-719 - accept = is_movable && ((mUUID != inv_item->getParentUUID()) || (mUUID == favorites_id)); + accept = is_movable && ((mUUID != inv_item->getParentUUID()) || folder_allows_reorder); if(accept && drop) { if (inv_item->getType() == LLAssetType::AT_GESTURE @@ -2877,12 +2879,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } // if dragging from/into favorites folder only reorder items - if ((mUUID == inv_item->getParentUUID()) && (favorites_id == mUUID)) + if ((mUUID == inv_item->getParentUUID()) && folder_allows_reorder) { LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLIsType is_type(LLAssetType::AT_LANDMARK); - model->collectDescendentsIf(favorites_id, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); + model->collectDescendentsIf(mUUID, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL; -- GitLab