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

Method UpdateCategory

src/Preferences.cpp:1753–1780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1751}
1752
1753bool CPreferences::UpdateCategory(
1754 uint8 cat,
1755 const wxString& name,
1756 const CPath& path,
1757 const wxString& comment,
1758 uint32 color,
1759 uint8 prio)
1760{
1761 Category_Struct *category = m_CatList[cat];
1762
1763 // return true if path is ok, false if not
1764 bool ret = true;
1765 if (!path.IsOk() || (!path.DirExists() && !CPath::MakeDir(path))) {
1766 ret = false;
1767 // keep path as it was
1768 } else if (category->path != path) {
1769 // path changed: reload shared files, adding files in the new path and removing those from the old path
1770 category->path = path;
1771 theApp->sharedfiles->Reload();
1772 }
1773 category->title = name;
1774 category->comment = comment;
1775 category->color = color;
1776 category->prio = prio;
1777
1778 SaveCats();
1779 return ret;
1780}
1781
1782
1783wxString CPreferences::GetBrowser()

Callers 3

CategoryUpdateFunction · 0.45
ApplyMethod · 0.45
OnBnClickedOkMethod · 0.45

Calls 3

DirExistsMethod · 0.80
IsOkMethod · 0.45
ReloadMethod · 0.45

Tested by 1

ApplyMethod · 0.36