virtual void done() { gInventory.removeObserver(this); // Link to all fetched items in COF. LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; for (uuid_vec_t::iterator it = mIDs.begin(); it != mIDs.end(); ++it) { LLUUID id = *it; LLViewerInventoryItem *item = gInventory.getItem(*it); if (!item) { llwarns << "fetch failed!" << llendl; continue; } link_inventory_item(gAgent.getID(), item->getLinkedUUID(), LLAppearanceMgr::instance().getCOF(), item->getName(), item->getDescription(), LLAssetType::AT_LINK, link_waiter); } }
void LLCOFMgr::addBOFLink(const LLUUID &idFolder, LLPointer<LLInventoryCallback> cb) { purgeBOFLink(); const LLViewerInventoryCategory* pFolder = gInventory.getCategory(idFolder); if ( (pFolder) && (LLFolderType::FT_OUTFIT == pFolder->getPreferredType()) ) link_inventory_item(gAgent.getID(), idFolder, getCOF(), pFolder->getName(), "", LLAssetType::AT_LINK_FOLDER, cb); }
void LLCOFMgr::addCOFItemLink(const LLInventoryItem* pItem, LLPointer<LLInventoryCallback> cb) { if ( (!pItem) || (isLinkInCOF(pItem->getLinkedUUID())) ) { return; } gInventory.addChangedMask(LLInventoryObserver::LABEL, pItem->getLinkedUUID()); const std::string strDescr = (pItem->getIsLinkType()) ? pItem->getDescription() : ""; link_inventory_item(gAgent.getID(), pItem->getLinkedUUID(), getCOF(), pItem->getName(), strDescr, LLAssetType::AT_LINK, cb); }
void LLLibraryOutfitsFetch::contentsDone() { llinfos << "start" << llendl; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; LLPointer<LLOrderMyOutfitsOnDestroy> order_myoutfits_on_destroy = new LLOrderMyOutfitsOnDestroy; for (uuid_vec_t::const_iterator folder_iter = mImportedClothingFolders.begin(); folder_iter != mImportedClothingFolders.end(); ++folder_iter) { const LLUUID &folder_id = (*folder_iter); const LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id); if (!cat) { llwarns << "Library folder import for uuid:" << folder_id << " failed to find folder." << llendl; continue; } //initial outfit should be already in My Outfits if (cat->getName() == LLStartUp::getInitialOutfitName()) continue; // First, make a folder in the My Outfits directory. LLUUID new_outfit_folder_id = gInventory.createNewCategory(mMyOutfitsID, LLFolderType::FT_OUTFIT, cat->getName()); cat_array.clear(); wearable_array.clear(); // Collect the contents of each imported clothing folder, so we can create new outfit links for it gInventory.collectDescendents(folder_id, cat_array, wearable_array, LLInventoryModel::EXCLUDE_TRASH); for (LLInventoryModel::item_array_t::const_iterator wearable_iter = wearable_array.begin(); wearable_iter != wearable_array.end(); ++wearable_iter) { const LLViewerInventoryItem *item = wearable_iter->get(); link_inventory_item(gAgent.getID(), item->getLinkedUUID(), new_outfit_folder_id, item->getName(), item->getDescription(), LLAssetType::AT_LINK, order_myoutfits_on_destroy); } } mOutfitsPopulated = true; }