summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-10-08 00:06:22 +0000
committerJames Cook <james@lindenlab.com>2009-10-08 00:06:22 +0000
commit35870c57070c52eae8fb135c6324036454becbeb (patch)
tree667ac8084b8802d2ec6aa380b37d769345fb96c3 /indra
parent584d0ac64e973da3a9096fb85b796716255988be (diff)
Nav bar only searches for existing landmarks in "My Favorites" and "Landmarks" folders. This is a partial fix for EXT-1402 Thousands of "WARNING: LLAssetStorage::getAssetData: Discarding duplicate request for asset". Somewhat reduces the number of asset downloads on login. Reviewed with Steve.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lllandmarkactions.cpp40
1 files changed, 29 insertions, 11 deletions
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp
index 0542199fc1..7c759e22a8 100644
--- a/indra/newview/lllandmarkactions.cpp
+++ b/indra/newview/lllandmarkactions.cpp
@@ -131,16 +131,36 @@ public:
}
};
+static void fetch_landmarks(LLInventoryModel::cat_array_t& cats,
+ LLInventoryModel::item_array_t& items,
+ LLInventoryCollectFunctor& add)
+{
+ // Look in "My Favorites"
+ LLUUID favorites_folder_id =
+ gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE);
+ gInventory.collectDescendentsIf(favorites_folder_id,
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ add);
+
+ // Look in "Landmarks"
+ LLUUID landmarks_folder_id =
+ gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
+ gInventory.collectDescendentsIf(landmarks_folder_id,
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ add);
+}
+
LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::string& name, BOOL use_substring)
{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
- LLFetchLandmarksByName fetchLandmarks(name, use_substring);
- gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
- cats,
- items,
- LLInventoryModel::EXCLUDE_TRASH,
- fetchLandmarks);
+ LLFetchLandmarksByName by_name(name, use_substring);
+ fetch_landmarks(cats, items, by_name);
+
return items;
}
@@ -151,17 +171,15 @@ bool LLLandmarkActions::landmarkAlreadyExists()
}
+// *TODO: This could be made more efficient by only fetching the FIRST
+// landmark that meets the criteria
LLViewerInventoryItem* LLLandmarkActions::findLandmarkForGlobalPos(const LLVector3d &pos)
{
// Determine whether there are landmarks pointing to the current parcel.
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLFetchlLandmarkByPos is_current_pos_landmark(pos);
- gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
- cats,
- items,
- LLInventoryModel::EXCLUDE_TRASH,
- is_current_pos_landmark);
+ fetch_landmarks(cats, items, is_current_pos_landmark);
if(items.empty())
{