Ejemplo n.º 1
0
// Checked: 2010-02-28 (RLVa-1.1.3a) | Modified: RLVa-1.0.0h
void RlvInventory::fetchSharedInventory()
{
	// Sanity check - don't fetch if we're already fetching, or if we don't have a shared root
	const LLViewerInventoryCategory* pRlvRoot = getSharedRoot();
	if ( (m_fFetchStarted) || (!pRlvRoot) )
		return;

	// Grab all the folders under the shared root
	LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items;
	gInventory.collectDescendents(pRlvRoot->getUUID(), folders, items, FALSE);

	// Add them to the "to fetch" list
	LLInventoryFetchDescendentsObserver::folder_ref_t fetchFolders;
	fetchFolders.push_back(pRlvRoot->getUUID());
	for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++)
		fetchFolders.push_back(folders.get(idxFolder)->getUUID());

	// Now fetch them all in one go
	RlvSharedInventoryFetcher* pFetcher = new RlvSharedInventoryFetcher();

	RLV_INFOS << "Starting fetch of " << fetchFolders.size() << " shared folders" << RLV_ENDL;
	pFetcher->fetchDescendents(fetchFolders);
	m_fFetchStarted = true;

	if (pFetcher->isEverythingComplete())
		pFetcher->done();
	else
		gInventory.addObserver(pFetcher);
}
Ejemplo n.º 2
0
void LLCOFMgr::fetchCOF()
{
    static bool sFetched = false;
    if (!sFetched)
    {
        const LLUUID idCOF = getCOF();
        if (idCOF.isNull())
        {
            LL_ERRS("COFMgr") << "Unable to find (or create) COF" << LL_ENDL;
            return;
        }

        LLInventoryFetchDescendentsObserver::folder_ref_t fetchFolders;
        fetchFolders.push_back(idCOF);

        LLCOFFetcher* pFetcher = new LLCOFFetcher();
        pFetcher->fetchDescendents(fetchFolders);
        if (pFetcher->isEverythingComplete())
            pFetcher->done();
        else
            gInventory.addObserver(pFetcher);

        sFetched = true;
    }
}