void vmsDownloadsGroupsMgr::DeleteGroup(vmsDownloadsGroupSmartPtr pGroup)
{
	PDLDS_GROUPS_TREE pGrp = FindGroupInTree (pGroup);
	PDLDS_GROUPS_TREE pRoot = pGrp->GetRoot ();
	for (int i = 0; i < pRoot->GetLeafCount (); i++)
	{
		if (pRoot->GetLeaf (i) == pGrp)
		{
			pRoot->DeleteLeaf (i);
			RebuildGroupsList ();

			if (pRoot == m_tGroups) {
				setDirty();
				getPersistObjectChildren ()->removePersistObject (i);
			} else {
				vmsDownloadsGroupSmartPtr pRootGroupPtr = pRoot->GetData();
				if ((vmsDownloadsGroup*)pRootGroupPtr != 0) {
					pRootGroupPtr->nChildren--;
					pRootGroupPtr->getPersistObjectChildren ()->removePersistObject (i);
					pRootGroupPtr->setDirty();
				}
			}

			
			
			
			return;
		}
	}
}
void vmsDownloadsGroupsMgr::RebuildGroupsList(PDLDS_GROUPS_TREE pRoot, std::vector <fs::ListTree <vmsDownloadsGroupSmartPtr>::ListTreePtr> &v)
{
	for (int i = 0; i < pRoot->GetLeafCount (); i++)
	{
		PDLDS_GROUPS_TREE pGroupTree = pRoot->GetLeaf (i);
		v.push_back (pGroupTree);
		RebuildGroupsList (pGroupTree, v);
	}
}
示例#3
0
void vmsDownloadsGroupsMgr::DeleteGroup(vmsDownloadsGroupSmartPtr pGroup)
{
    PDLDS_GROUPS_TREE pGrp = FindGroupInTree (pGroup);
    PDLDS_GROUPS_TREE pRoot = pGrp->GetRoot ();
    for (int i = 0; i < pRoot->GetLeafCount (); i++)
    {
        if (pRoot->GetLeaf (i) == pGrp)
        {
            pRoot->DeleteLeaf (i);
            RebuildGroupsList ();
            QueryStoringGroupsInformation();
            return;
        }
    }
}
void vmsDownloadsGroupsMgr::RebuildGroupsList()
{
	std::vector <fs::ListTree <vmsDownloadsGroupSmartPtr>::ListTreePtr> v;
	RebuildGroupsList (m_tGroups, v);
	m_vGroups = v;
}