X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOGimmick.cpp;h=2d759d0b29a2862547278e8aac7a379ae0e51d4f;hb=d1635bf73accf21c07f6315ed04609d703250269;hp=01e49bd352d5a29bc655e57420fb98b71c89c57b;hpb=e71f3f9eee510c110566fbdce60c569094e45307;p=creaImageIO.git diff --git a/src2/creaImageIOGimmick.cpp b/src2/creaImageIOGimmick.cpp index 01e49bd..2d759d0 100644 --- a/src2/creaImageIOGimmick.cpp +++ b/src2/creaImageIOGimmick.cpp @@ -30,48 +30,19 @@ namespace creaImageIO //============================================================== void Gimmick::Initialize() { + std::string i_nameDB = "Local database"; // Create the UserSettings dir if does not exist CreateUserSettingsDirectory(); // Sets the current directory to the home dir mCurrentDirectory = GetHomeDirectory(); mSynchronizer=0; - // Create local database handler - mLocalDatabase = new SQLiteTreeHandler(GetLocalDatabasePath()); - // Add it to the TreeHandlerMap - mTreeHandlerMap["Local database"] = mLocalDatabase; + std::string dbpath = GetLocalDatabasePath(); // Create or open local database - if (! boost::filesystem::exists( GetLocalDatabasePath() ) ) - { - std::string mess = "Local database '"; - mess += GetLocalDatabasePath(); - mess += "' does not exist : creating it"; - GimmickMessage(1,mess<GetTree().GetDescriptor().CreateDefault(); - mLocalDatabase->GetTree().GetDescriptor().createDescriptorfromFile(mCurrentDirectory + "\\.gimmick\\localdatabase_Descriptor.txt"); - - if ( ! mLocalDatabase->Create(true) ) - { - GimmickError("ERROR CREATING '"<SetAttribute(0,"Name","Local database"); - } - else - { - /// Open and test it - GimmickMessage(1,"Opening local database '" - <Open(true) ) - { - GimmickError("ERROR OPENING '"<GetTree().GetDescriptor().createDescriptorfromFile(i_locDesc); + if ( ! sqlTreeH->Create(true) ) + { + GimmickError("ERROR CREATING '"<SetAttribute(0,"Name","i_name"); + } + else + { + /// Open and test it + GimmickMessage(1,"Opening local database '" <Open(true) ) + { + GimmickError("ERROR OPENING '"<second; + } delete mTimestampDatabase; } //==============================================================