void LLFloaterWorldMap::buildLandmarkIDLists() { LLCtrlListInterface *list = childGetListInterface("landmark combo"); if (!list) { return; } // Delete all but the "None" entry S32 list_size = list->getItemCount(); if (list_size > 1) { list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } mLandmarkItemIDList.reset(); mLandmarkAssetIDList.reset(); // Get all of the current landmarks mLandmarkAssetIDList.put( LLUUID::null ); mLandmarkItemIDList.put( LLUUID::null ); mLandmarkAssetIDList.put( sHomeID ); mLandmarkItemIDList.put( sHomeID ); LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLIsType is_landmark(LLAssetType::AT_LANDMARK); gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), cats, items, LLInventoryModel::EXCLUDE_TRASH, is_landmark); std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers()); S32 count = items.count(); for(S32 i = 0; i < count; ++i) { LLInventoryItem* item = items.get(i); list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID()); mLandmarkAssetIDList.put( item->getAssetUUID() ); mLandmarkItemIDList.put( item->getUUID() ); } list->sortByColumn(std::string("landmark name"), TRUE); list->selectFirstItem(); }
void LLFloaterWorldMap::buildLandmarkIDLists() { LLCtrlListInterface *list = mListLandmarkCombo; if (!list) return; // Delete all but the "None" entry S32 list_size = list->getItemCount(); if (list_size > 1) { list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } mLandmarkItemIDList.reset(); mLandmarkAssetIDList.reset(); // Get all of the current landmarks mLandmarkAssetIDList.put( LLUUID::null ); mLandmarkItemIDList.put( LLUUID::null ); mLandmarkAssetIDList.put( sHomeID ); mLandmarkItemIDList.put( sHomeID ); LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLIsType is_landmark(LLAssetType::AT_LANDMARK); gInventory.collectDescendentsIf(gInventory.getRootFolderID(), cats, items, LLInventoryModel::EXCLUDE_TRASH, is_landmark); std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers()); std::list<LLInventoryItem*> usedLMs; BOOL filterLandmarks = gSavedSettings.getBOOL("WorldmapFilterDuplicateLandmarks"); S32 count = items.count(); for(S32 i = 0; i < count; ++i) { LLInventoryItem* item = items.get(i); if (filterLandmarks) { bool skip = false; for (std::list<LLInventoryItem*>::iterator it = usedLMs.begin(); it != usedLMs.end(); ++it) { if ((*it)->getAssetUUID() == item->getAssetUUID()) { skip = true; break; } } if (skip) continue; usedLMs.push_front(item); } list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID()); mLandmarkAssetIDList.put( item->getAssetUUID() ); mLandmarkItemIDList.put( item->getUUID() ); } list->selectFirstItem(); }