added: to the Item: auth_path - a path to a static file (if auth is different from auth_none)
added: function 'mv' (move) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@596 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -131,6 +131,45 @@ return last_iter;
|
||||
|
||||
|
||||
|
||||
bool DirContainer::ChangeParent(long dir_id, long new_parent_id)
|
||||
{
|
||||
Iterator i = FindId(dir_id);
|
||||
|
||||
if( i == table.end() )
|
||||
return false;
|
||||
|
||||
if( i->parent_id == new_parent_id )
|
||||
return true; // nothing to do
|
||||
|
||||
ParentIterator p = FindFirstParent(i->parent_id);
|
||||
bool found = false;
|
||||
|
||||
for( ; p != table_parent.end() ; p = NextParent(p) )
|
||||
{
|
||||
if( p->second->id == dir_id )
|
||||
{
|
||||
table_parent.erase(p);
|
||||
log << log3 << "DirCont: removed parent index to dir: " << i->id << logend;
|
||||
|
||||
i->parent_id = new_parent_id;
|
||||
table_parent.insert( std::make_pair(new_parent_id, i) );
|
||||
log << log3 << "DirCont: added parent index to dir, id: " << i->id << ", parent_id: " << i->parent_id << logend;
|
||||
|
||||
found = true;
|
||||
|
||||
if( i->url == "etc" ) // !! in the future can be more special folders
|
||||
FindSpecialFolders();
|
||||
|
||||
break; // that iterator (p) is only one
|
||||
}
|
||||
}
|
||||
|
||||
if( !found )
|
||||
log << log1 << "DirCont: cannot find parent_id: " << i->parent_id << " in parent indexes" << logend;
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DirContainer::Clear()
|
||||
|
||||
Reference in New Issue
Block a user