//************************************************************************ // deinitializes the list //************************************************************************ bool CContactList::Shutdown() { if(!CLCDList<CContactListEntry*,CContactListGroup*>::Shutdown()) return false; UninitializeGroupObjects(); return false; }
//************************************************************************ // initializes the group objects //************************************************************************ void CContactList::InitializeGroupObjects() { UninitializeGroupObjects(); int res = 0; CContactListGroup *pGroup = NULL; HANDLE hContact = db_find_first(); HANDLE hMetaContact = NULL; char *szProto = NULL; while(hContact != NULL) { tstring strGroup = GetContactGroupPath(hContact); szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(UINT)hContact,0); if(szProto && db_get_b(NULL,"MetaContacts","Enabled",1) && !stricmp(szProto,"MetaContacts")) { tstring strName = CAppletManager::GetContactDisplayname(hContact); tstring strPath = _T(""); if(CConfig::GetBoolSetting(CLIST_USEGROUPS)) strPath += strGroup; strPath += (strPath.empty()?_T(""):_T("\\")) + strName; pGroup = CreateGroupObjectByPath(strPath); pGroup->hMetaContact = hContact; if(!strGroup.empty()) ChangeGroupObjectCounters(strGroup,1); } // If the contact has no group, continue else if(!strGroup.empty() && CConfig::GetBoolSetting(CLIST_USEGROUPS)) { pGroup = GetGroupObjectByPath(strGroup); // create the group if(!pGroup) pGroup = CreateGroupObjectByPath(strGroup); // update it's counters if(!CAppletManager::IsSubContact(hContact)) ChangeGroupObjectCounters(strGroup,1); } hContact = db_find_next(hContact); } }
//************************************************************************ // initializes the group objects //************************************************************************ void CContactList::InitializeGroupObjects() { UninitializeGroupObjects(); int res = 0; CContactListGroup *pGroup = NULL; HANDLE hMetaContact = NULL; char *szProto = NULL; for(MCONTACT hContact = db_find_first();hContact != NULL;hContact = db_find_next(hContact)) { tstring strGroup = GetContactGroupPath(hContact); szProto = GetContactProto(hContact); if(szProto && db_get_b(NULL,META_PROTO,"Enabled",1) && !mir_strcmpi(szProto,META_PROTO)) { tstring strName = CAppletManager::GetContactDisplayname(hContact); tstring strPath = _T(""); if(CConfig::GetBoolSetting(CLIST_USEGROUPS)) strPath += strGroup; strPath += (strPath.empty()?_T(""):_T("\\")) + strName; pGroup = CreateGroupObjectByPath(strPath); pGroup->hMetaContact = hContact; if(!strGroup.empty()) ChangeGroupObjectCounters(strGroup,1); } // If the contact has no group, continue else if(!strGroup.empty() && CConfig::GetBoolSetting(CLIST_USEGROUPS)) { pGroup = GetGroupObjectByPath(strGroup); // create the group if(!pGroup) pGroup = CreateGroupObjectByPath(strGroup); // update it's counters if(!db_mc_isSub(hContact)) ChangeGroupObjectCounters(strGroup,1); } } }