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

Method LoadCats

src/Preferences.cpp:1639–1678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1637
1638
1639void CPreferences::LoadCats()
1640{
1641 // default cat ... Meow! =(^.^)=
1642 Category_Struct* defaultcat = new Category_Struct;
1643 defaultcat->prio = 0;
1644 defaultcat->color = 0;
1645
1646 AddCat( defaultcat );
1647
1648 wxConfigBase* cfg = wxConfigBase::Get();
1649
1650 long max = cfg->Read( "/General/Count", 0l );
1651
1652 for ( int i = 1; i <= max ; i++ ) {
1653 cfg->SetPath(CFormat("/Cat#%i") % i);
1654
1655 Category_Struct* newcat = new Category_Struct;
1656
1657 newcat->title = cfg->Read( "Title", "" );
1658 newcat->path = CPath::FromUniv(cfg->Read("Incoming", ""));
1659
1660 // Some sanity checking
1661 if ( newcat->title.IsEmpty() || !newcat->path.IsOk() ) {
1662 AddLogLineN(_("Invalid category found, skipping"));
1663
1664 delete newcat;
1665 continue;
1666 }
1667
1668 newcat->comment = cfg->Read( "Comment", "" );
1669 newcat->prio = cfg->Read( "Priority", 0l );
1670 newcat->color = StrToULong(cfg->Read("Color", "0"));
1671
1672 AddCat(newcat);
1673
1674 if (!newcat->path.DirExists()) {
1675 CPath::MakeDir(newcat->path);
1676 }
1677 }
1678}
1679
1680
1681uint16 CPreferences::GetDefaultMaxConperFive()

Callers

nothing calls this directly

Calls 7

CFormatClass · 0.85
StrToULongFunction · 0.85
SetPathMethod · 0.80
DirExistsMethod · 0.80
ReadMethod · 0.45
IsEmptyMethod · 0.45
IsOkMethod · 0.45

Tested by

no test coverage detected