From 3389d962d93ac6547944fb52a53acbb73be74706 Mon Sep 17 00:00:00 2001 From: Frederic Cervenansky Date: Wed, 1 Sep 2010 16:19:58 +0000 Subject: [PATCH] correction of bugs --- CMakeLists.txt | 4 ++-- src/creaImageIOGimmick.cpp | 2 +- src/creaImageIOTreeHandlerImageAdder.cpp | 30 ++++++++++-------------- src/creaImageIOTreeHandlerImageAdder.h | 3 +++ 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d6e6d2..1fbdf84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,8 +45,8 @@ IF(USE_QT4) ENDIF(USE_QT4) -OPTION(USE_GDCM ON) -OPTION(USE_GDCM2 OFF) +OPTION(USE_GDCM "Use gdcm 1.3" ON) +OPTION(USE_GDCM2 "Use gdcm 2.0.14 at least" OFF) MESSAGE(STATUS "GDCM LIB ....= ${GDCM_LIBRARIES}") IF(USE_GDCM2) OPTION(USE_GDCM_ANOM "use gdcm2 anonymizer tool" OFF) diff --git a/src/creaImageIOGimmick.cpp b/src/creaImageIOGimmick.cpp index 311deba..3ee7420 100644 --- a/src/creaImageIOGimmick.cpp +++ b/src/creaImageIOGimmick.cpp @@ -9,7 +9,7 @@ # define PATH_MAX 2048 #endif #include -#include + #ifdef _DEBUG #define new DEBUG_NEW #endif diff --git a/src/creaImageIOTreeHandlerImageAdder.cpp b/src/creaImageIOTreeHandlerImageAdder.cpp index 34be57a..3e2ff04 100644 --- a/src/creaImageIOTreeHandlerImageAdder.cpp +++ b/src/creaImageIOTreeHandlerImageAdder.cpp @@ -138,19 +138,8 @@ namespace creaImageIO } 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<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); + } } //===================================================================== @@ -167,7 +156,16 @@ namespace creaImageIO } 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 @@ -179,11 +177,7 @@ namespace creaImageIO 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); - } - - } } - //======================================================================= diff --git a/src/creaImageIOTreeHandlerImageAdder.h b/src/creaImageIOTreeHandlerImageAdder.h index 4797422..9800a7a 100644 --- a/src/creaImageIOTreeHandlerImageAdder.h +++ b/src/creaImageIOTreeHandlerImageAdder.h @@ -119,6 +119,9 @@ namespace creaImageIO void RemoveFile(tree::Node* node); /// Removes files from the databases void RemoveFiles(const std::vector& 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 -- 2.47.1