X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOGimmick.cpp;h=ced62fa28882e1d5ca1b9e6f6fd49dc631a3a642;hb=f130d194cc0f1c9380f3907a45020e199e4b5c0a;hp=b7cc5f7b5ad1874e36fdd725515fdf2d569a3faa;hpb=f4bdead5143dc3d816f1c2f2bd9786a21c843760;p=creaImageIO.git diff --git a/src2/creaImageIOGimmick.cpp b/src2/creaImageIOGimmick.cpp index b7cc5f7..ced62fa 100644 --- a/src2/creaImageIOGimmick.cpp +++ b/src2/creaImageIOGimmick.cpp @@ -1,18 +1,19 @@ #include -#include +#include #include #include namespace creaImageIO { - + + //============================================================== Gimmick::Gimmick() + : mImageAdder(0) { - crea::MessageManager::RegisterMessageType("Gimmick!", - "Gimmick",1); + RegisterGimmickMessageTypes(); } //============================================================== @@ -27,55 +28,53 @@ namespace creaImageIO //============================================================== - bool Gimmick::Initialize() + void Gimmick::Initialize() { // Create the UserSettings dir if does not exist - if (!CreateUserSettingsDirectory()) return false; + CreateUserSettingsDirectory(); // Sets the current directory to the home dir mCurrentDirectory = GetHomeDirectory(); // Create local database handler mLocalDatabase = new SQLiteTreeHandler(GetLocalDatabasePath()); + // Add it to the TreeHandlerMap + mTreeHandlerMap["Local database"] = mLocalDatabase; + // Create or open local database if (! boost::filesystem::exists( GetLocalDatabasePath() ) ) { - creaMessage("Gimmick!",1, - "[Gimmick!] Local database '"<GetTree().GetDescriptor().CreateDefault(); if ( ! mLocalDatabase->Create(true) ) { - creaMessage("Gimmick!",1, - "[Gimmick!] !! ERROR CREATING '"<SetAttribute(0,"Name","Local database"); } else { /// Open and test it - creaMessage("Gimmick!",1, - "[Gimmick!] Opening local database '" - <Open(true) ) { - creaMessage("Gimmick!",1, - "[Gimmick!] !! ERROR OPENING '"<second; + } + + + //======================================================================== + /// Add the files to the tree handler + void Gimmick::AddFiles(const std::string& d, + const std::vector& filenames) + { + GimmickMessage(2,"Adding files to '"<GetTree().Print(); + } + //======================================================================== + + }