Ejemplo n.º 1
0
// Copy the clothing folders from the library into the imported clothing folder
void LLLibraryOutfitsFetch::libraryDone()
{
	llinfos << "start" << llendl;

	if (mImportedClothingID != LLUUID::null)
	{
		// Skip straight to fetching the contents of the imported folder
		importedFolderFetch();
		return;
	}

	// Remove observer; next autopopulation step will be triggered externally by LLLibraryOutfitsCopyDone.
	gInventory.removeObserver(this);
	
	LLPointer<LLInventoryCallback> copy_waiter = new LLLibraryOutfitsCopyDone(this);
	mImportedClothingID = gInventory.createNewCategory(mClothingID,
													   LLFolderType::FT_NONE,
													   mImportedClothingName);
	// Copy each folder from library into clothing unless it already exists.
	for (uuid_vec_t::const_iterator iter = mLibraryClothingFolders.begin();
		 iter != mLibraryClothingFolders.end();
		 ++iter)
	{
		const LLUUID& src_folder_id = (*iter); // Library clothing folder ID
		const LLViewerInventoryCategory *cat = gInventory.getCategory(src_folder_id);
		if (!cat)
		{
			llwarns << "Library folder import for uuid:" << src_folder_id << " failed to find folder." << llendl;
			continue;
		}
		
		if (!LLAppearanceMgr::getInstance()->getCanMakeFolderIntoOutfit(src_folder_id))
		{
			llinfos << "Skipping non-outfit folder name:" << cat->getName() << llendl;
			continue;
		}
		
		// Don't copy the category if it already exists.
		LLNameCategoryCollector matchFolderFunctor(cat->getName());
		LLInventoryModel::cat_array_t cat_array;
		LLInventoryModel::item_array_t wearable_array;
		gInventory.collectDescendentsIf(mImportedClothingID, 
										cat_array, wearable_array, 
										LLInventoryModel::EXCLUDE_TRASH,
										matchFolderFunctor);
		if (cat_array.size() > 0)
		{
			continue;
		}

		LLUUID dst_folder_id = gInventory.createNewCategory(mImportedClothingID,
															LLFolderType::FT_NONE,
															cat->getName());
		LLAppearanceMgr::getInstance()->shallowCopyCategoryContents(src_folder_id, dst_folder_id, copy_waiter);
	}
}
Ejemplo n.º 2
0
void LLLibraryOutfitsFetch::outfitsDone()
{
	llinfos << "start" << llendl;

	LLInventoryModel::cat_array_t cat_array;
	LLInventoryModel::item_array_t wearable_array;
	uuid_vec_t folders;
	
	// Collect the contents of the Library's Clothing folder
	gInventory.collectDescendents(mLibraryClothingID, cat_array, wearable_array, 
								  LLInventoryModel::EXCLUDE_TRASH);
	
	llassert(cat_array.count() > 0);
	for (LLInventoryModel::cat_array_t::const_iterator iter = cat_array.begin();
		 iter != cat_array.end();
		 ++iter)
	{
		const LLViewerInventoryCategory *cat = iter->get();
		
		// Get the names and id's of every outfit in the library, skip "Ruth"
		// because it's a low quality legacy outfit
		if (cat->getName() != "Ruth")
		{
			// Get the name of every outfit in the library 
			folders.push_back(cat->getUUID());
			mLibraryClothingFolders.push_back(cat->getUUID());
		}
	}
	cat_array.clear();
	wearable_array.clear();

	// Check if you already have an "Imported Library Clothing" folder
	LLNameCategoryCollector matchFolderFunctor(mImportedClothingName);
	gInventory.collectDescendentsIf(mClothingID, 
									cat_array, wearable_array, 
									LLInventoryModel::EXCLUDE_TRASH,
									matchFolderFunctor);
	if (cat_array.size() > 0)
	{
		const LLViewerInventoryCategory *cat = cat_array.get(0);
		mImportedClothingID = cat->getUUID();
	}
	
	mComplete.clear();
	setFetchIDs(folders);
	startFetch();
	if (isFinished())
	{
		done();
	}
}
Ejemplo n.º 3
0
void LLLibraryOutfitsFetch::folderDone()
{
	llinfos << "start" << llendl;

	LLInventoryModel::cat_array_t cat_array;
	LLInventoryModel::item_array_t wearable_array;
	gInventory.collectDescendents(mMyOutfitsID, cat_array, wearable_array, 
								  LLInventoryModel::EXCLUDE_TRASH);
	
	// Early out if we already have items in My Outfits
	// except the case when My Outfits contains just initial outfit
	if (cat_array.count() > 1)
	{
		mOutfitsPopulated = true;
		return;
	}

	mClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
	mLibraryClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING, false, true);

	// If Library->Clothing->Initial Outfits exists, use that.
	LLNameCategoryCollector matchFolderFunctor("Initial Outfits");
	cat_array.clear();
	gInventory.collectDescendentsIf(mLibraryClothingID,
									cat_array, wearable_array, 
									LLInventoryModel::EXCLUDE_TRASH,
									matchFolderFunctor);
	if (cat_array.count() > 0)
	{
		const LLViewerInventoryCategory *cat = cat_array.get(0);
		mLibraryClothingID = cat->getUUID();
	}

	mComplete.clear();
	
	// Get the complete information on the items in the inventory.
	uuid_vec_t folders;
	folders.push_back(mClothingID);
	folders.push_back(mLibraryClothingID);
	setFetchIDs(folders);
	startFetch();
	if (isFinished())
	{
		done();
	}
}
Ejemplo n.º 4
0
const LLUUID& LLFriendCardsManager::findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName) const
{
	LLNameCategoryCollector matchFolderFunctor(nonLocalizedName);

	return get_folder_uuid(parentFolderUUID, matchFolderFunctor);
}