}
else
{
- std::string path=node->GetAttribute("FullFileName");
- //Gets the add key
- std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","IGNORED_FILES","PATH",path,mCurrentDB);
- //Gets the number of files added
- int files=atoi((mSynchronizer->GetAttribute("FILES_ADDED","ADD_OPS","ADD_KEY",addKey,mCurrentDB)).c_str());
- files=files-1;
- std::stringstream out;
- out<<files;
- //Sets the new number of files
- mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",addKey,mCurrentDB);
- //Sets the file as removed
- mSynchronizer->SetAttribute("REMOVE","IGNORED_FILES","1","PATH = '"+path+"' AND ADD_KEY",addKey,mCurrentDB);
- }
+ remove(node);
+ }
}
//=====================================================================
}
else
{
- std::string path=(*it)->GetAttribute("FullFileName");
+ remove(*it);
+ }
+
+ }
+ }
+
+
+ void TreeHandlerImageAdder::remove( tree::Node* i_node)
+ {
+ std::string path=i_node->GetAttribute("FullFileName");
//Gets the add key
std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","IGNORED_FILES","PATH",path,mCurrentDB);
//Gets the number of files added
mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",addKey,mCurrentDB);
//Sets the file as removed
mSynchronizer->SetAttribute("REMOVE","IGNORED_FILES","1","PATH = '"+path+"' AND ADD_KEY",addKey,mCurrentDB);
- }
-
- }
}
-
//=======================================================================
void RemoveFile(tree::Node* node);
/// Removes files from the databases
void RemoveFiles(const std::vector<tree::Node*>& nodes);
+
+ void remove( tree::Node* i_node);
+
/// Synchronizes the DB and disk by repeating the operations the user has done and returns a report
std::string Synchronize(bool repair, bool checkAttributes);
///Recursively checks if the directory is synchronized and optionally the state of the attributes