//==============================================================
void Gimmick::Initialize()
{
-printf("EED Gimmick::Initialize 1\n");
std::string i_nameDB = mLocalDBName;
// Create the UserSettings dir if does not exist
-printf("EED Gimmick::Initialize 1 A\n");
CreateUserSettingsDirectory();
-printf("EED Gimmick::Initialize 1 B\n");
// Sets the current directory to the home dir
mCurrentDirectory = GetHomeDirectory();
- printf("EED Gimmick::Initialize 1 C\n");
mSynchronizer= new Synchronizer(GetUserSettingsDirectory()+"Shared/gimmick/");
- printf("EED Gimmick::Initialize 1 D\n");
mSettings = new Settings(mCurrentDirectory);
- printf("EED Gimmick::Initialize 1.1\n");
std::string dbpath = GetLocalDatabasePath();
// Create or open local database
boost::algorithm::replace_all( dpath,
INVALID_FILE_SEPARATOR ,
VALID_FILE_SEPARATOR);
- printf("EED Gimmick::Initialize 1.2\n");
mLocalDatabase = createDB(i_nameDB, dpath, dbpath);
- printf("EED Gimmick::Initialize 1.3\n");
// Add it to the TreeHandlerMap
mTreeHandlerMap[i_nameDB] = mLocalDatabase;
//Add additional DB from user Settings
addDBSettings();
- printf("EED Gimmick::Initialize 2\n");
}
///////////////////////////////////////////////////////////////////////
void Gimmick::CreateUserSettingsDirectory()
{
-printf("EED Gimmick::CreateUserSettingsDirectory 1\n");
// std::string st("C:/Documents and Settings/cervenansky/.gimmick/");
// boost::algorithm::replace_all( st,
// INVALID_FILE_SEPARATOR ,
GimmickMessage(1,"Directory '"<<GetUserSettingsDirectory()<<"' "
<< "does not exist : creating it"<<std::endl);
-printf("EED Gimmick::CreateUserSettingsDirectory 2\n");
if ( ! boost::filesystem::create_directory( GetUserSettingsDirectory() ) )
{
GimmickError("ERROR CREATING '"<<GetUserSettingsDirectory()<<"'");
}
}
-printf("EED Gimmick::CreateUserSettingsDirectory 3\n");
std::string setDir=GetUserSettingsDirectory();
boost::algorithm::replace_all( setDir,
setDir+="gimmick/";
boost::filesystem::create_directory( setDir );
setDir+=mLocalDescpName;
-printf("EED Gimmick::CreateUserSettingsDirectory 5\n");
if(!boost::filesystem::is_regular(setDir))
{
#if defined(_WIN32)
path+="/bin/share/gimmick/";
- printf("EED Gimmick::CreateUserSettingsDirectory 01xxx\n");
#endif
#if defined (LINUX)
path+="/../share/gimmick/";
- printf("EED Gimmick::CreateUserSettingsDirectory 03xxx\n");
#endif
#if defined(__APPLE__)
path+="/../../../../share/gimmick/";
- printf("EED Gimmick::CreateUserSettingsDirectory 02xxx\n");
#endif
boost::algorithm::replace_all( path,
INVALID_FILE_SEPARATOR ,
VALID_FILE_SEPARATOR);
-printf("EED Gimmick::CreateUserSettingsDirectory 5.1 %s >>> %s \n", path.c_str(), setDir.c_str() );
-printf("EED Gimmick::CreateUserSettingsDirectory 5.1.1 %s \n", mLocalDescpName.c_str() );
boost::filesystem::copy_file(path,setDir);
-printf("EED Gimmick::CreateUserSettingsDirectory 5.2\n");
}
-printf("EED Gimmick::CreateUserSettingsDirectory 6\n");
}
//========================================================================