# define PATH_MAX 2048
#endif
+#ifdef _RELWITHDEBINFO
+#define new DEBUG_NEW
+#endif
+
+
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
RegisterGimmickMessageTypes();
mSettings=0;
mSynchronizer=0;
+ mLocalDescpName = "localdatabase_Descriptor.dscp";
+ mLocalDBName = "Local database";
}
//==============================================================
//==============================================================
//==============================================================
- void Gimmick::Initialize(const std::string& path)
+ void Gimmick::Initialize(const std::string& i_namedescp, const std::string i_namedb)
{
+ mLocalDescpName = i_namedescp;
+ mLocalDBName = i_namedb;
Initialize();
}
//==============================================================
void Gimmick::Initialize()
{
- std::string i_nameDB = "Local database";
+ std::string i_nameDB = mLocalDBName;
// Create the UserSettings dir if does not exist
CreateUserSettingsDirectory();
// Sets the current directory to the home dir
std::string dbpath = GetLocalDatabasePath();
// Create or open local database
- std::string dpath= mCurrentDirectory + "/.gimmick/Shared/gimmick/localdatabase_Descriptor.dscp";
+ std::string dpath= mCurrentDirectory + "/.gimmick/Shared/gimmick/" + mLocalDescpName;
boost::algorithm::replace_all( dpath,
INVALID_FILE_SEPARATOR ,
VALID_FILE_SEPARATOR);
boost::filesystem::create_directory( setDir );
setDir+="gimmick/";
boost::filesystem::create_directory( setDir );
- setDir+="localdatabase_Descriptor.dscp";
+ setDir+=mLocalDescpName;
if(!boost::filesystem::is_regular(setDir))
{
// The following stuff works on Linux, NOT CHECKED on Windows // JPR
#if defined(_WIN32)
- path+="/bin/Shared/gimmick/localdatabase_Descriptor.dscp";
+ path+="/bin/Shared/gimmick/";
+ path+=mLocalDescpName;
#else
- path+="/Shared/gimmick/localdatabase_Descriptor.dscp";
+ path+="/Shared/gimmick/";
+ path+= mLocalDescpName;
#endif
std::cout <<"From: " << path <<std::endl;
std::cout <<"To: " << setDir <<std::endl;
#include <creaImageIOSynchron.h>
#include <creaImageIOSettings.h>
+#ifdef _RELWITHDEBINFO
+#include <crtdbg.h>
+#define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__)
+#else
+#define DEBUG_NEW new
+#endif
#ifdef _DEBUG
#include <crtdbg.h>
void Initialize();
/// Initializes with the local database descriptor in the path given (read/creates databases, etc.)
- void Initialize(const std::string& path);
+ void Initialize(const std::string& namedescp, const std::string namedb = "Local Database");
/// Finalize (closes databases, etc.)
void Finalize();
std::string mLocalDatabasePath;
Settings *mSettings;
TreeHandlerImageAdder mImageAdder;
+ std::string mLocalDBName;
+ std::string mLocalDescpName;
};
// EO class Gimmick
//=======================================================================