added: 'rm' function can remove auth content now

git-svn-id: svn://ttmath.org/publicrep/winix/trunk@597 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-03-15 17:09:45 +00:00
parent 6fbcffe63b
commit aff4cc516e
7 changed files with 162 additions and 79 deletions

View File

@@ -387,31 +387,14 @@ void Dirs::SplitPath(const std::string & path, std::string & dir, std::string &
// !! przeniesc to do rm
// mamy juz interfejs do chodzenia po parentach
void Dirs::DeleteDir(long id)
bool Dirs::DelDir(long dir_id)
{
DirContainer::ParentIterator pnext, p = dir_table.FindFirstParent(id);
for( ; p != dir_table.ParentEnd() ; p = pnext )
{
// this iterator p will be deleted by the next DeleteDir(p->second->id)
// (the next iterator we must calculate beforehand)
pnext = dir_table.NextParent(p);
DeleteDir(p->second->id);
}
if( db.DelDirById(id) == WINIX_ERR_OK )
dir_table.DelById(id);
db.RemoveThread(id);
db.RemoveTicket(id);
return dir_table.DelById(dir_id);
}