X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOGimmick.cpp;h=90dc2c8fcf716f2a088eaa543fce4bcc5c12f0e6;hb=cc5a912f64e8de1f90d9ef0956633515a46d31ae;hp=01e49bd352d5a29bc655e57420fb98b71c89c57b;hpb=36a4ac578a165ab010663055b433aef6d9248e22;p=creaImageIO.git diff --git a/src2/creaImageIOGimmick.cpp b/src2/creaImageIOGimmick.cpp index 01e49bd..90dc2c8 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; } //==============================================================