MCPcopy Create free account
hub / github.com/amule-project/amule / SaveCats

Method SaveCats

src/Preferences.cpp:1603–1630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1601
1602
1603void CPreferences::SaveCats()
1604{
1605 if ( GetCatCount() ) {
1606 wxConfigBase* cfg = wxConfigBase::Get();
1607
1608 // Save the main cat.
1609 cfg->Write( "/eMule/AllcatType", (int)s_allcatFilter);
1610
1611 // The first category is the default one and should not be counted
1612
1613 cfg->Write( "/General/Count", (long)(m_CatList.size() - 1) );
1614
1615 uint32 maxcat = m_CatList.size();
1616 for (uint32 i = 1; i < maxcat; i++) {
1617 cfg->SetPath(CFormat("/Cat#%i") % i);
1618
1619 cfg->Write( "Title", m_CatList[i]->title );
1620 cfg->Write( "Incoming", CPath::ToUniv(m_CatList[i]->path) );
1621 cfg->Write( "Comment", m_CatList[i]->comment );
1622 cfg->Write( "Color", wxString(CFormat("%u") % m_CatList[i]->color));
1623 cfg->Write( "Priority", (int)m_CatList[i]->prio );
1624 }
1625 // remove deleted cats from config
1626 while (cfg->DeleteGroup(CFormat("/Cat#%i") % maxcat++)) {}
1627
1628 cfg->Flush();
1629 }
1630}
1631
1632
1633void CPreferences::LoadPreferences()

Callers 3

RemoveCategoryMethod · 0.80
OnSetDefaultCatMethod · 0.80
CategoryDeleteFunction · 0.80

Calls 7

CFormatClass · 0.85
SetPathMethod · 0.80
DeleteGroupMethod · 0.80
wxStringClass · 0.70
WriteMethod · 0.45
sizeMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected