X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOSettings.cpp;h=92908785bc43de2a340dfba8254150d64e3ad3a7;hb=e13ea6551e8721b11998dc33ddccf3f89458f173;hp=88ca918db48b35b2135e57a5458c97a97d42dddb;hpb=852af4a5c6e97a6fc349126cf3370e27f89fe067;p=creaImageIO.git diff --git a/src2/creaImageIOSettings.cpp b/src2/creaImageIOSettings.cpp index 88ca918..9290878 100644 --- a/src2/creaImageIOSettings.cpp +++ b/src2/creaImageIOSettings.cpp @@ -12,7 +12,7 @@ namespace creaImageIO Settings::Settings(const std::string i_path) { //need to position path in user directory first. - m_SettingsFileName = i_path + "\\.gimmick\\app.config"; + m_SettingsFileName = i_path + "\\.gimmick\\Shared\\gimmick\\app.config"; //Test if Settings File exist if(!boost::filesystem::exists(m_SettingsFileName) ) { @@ -34,6 +34,7 @@ namespace creaImageIO Keys.push_back(SETTINGS_SYNC_EVENT); Keys.push_back(SETTINGS_DBPATH); Keys.push_back(SETTINGS_SYNC_FREQ); + Keys.push_back(SETTINGS_COPY_PATH); readSettings(Keys, sets); } @@ -55,6 +56,7 @@ namespace creaImageIO m_SettingsMap[SETTINGS_SYNC_EVENT] = "end"; m_SettingsMap[SETTINGS_DBPATH] = ""; m_SettingsMap[SETTINGS_DICOM_LIBRARY] = "gdcm"; + m_SettingsMap[SETTINGS_COPY_PATH] = m_SettingsFileName.substr(0,m_SettingsFileName.find_last_of('\\')+1)+"Copied files"; writeSettingsFile(); } @@ -77,6 +79,18 @@ namespace creaImageIO } } } + + //////////////////////////////////////////////////////////////////////////////////////////////// + // Update settings in config file // + // @param key : Key to update // + // @param value: New value to set // + // return : - + /////////////////////////////////////////////////////////////////////////////////////////////// + void Settings::updateSetting(const std::string& key, const std::string &val) + { + m_SettingsMap[key.c_str()] = val; + } + //////////////////////////////////////////////////////////////////////////////////////////////// // add a path to a DB // // @param i_path : DB path to add // @@ -131,6 +145,6 @@ namespace creaImageIO ofs.clear(); writeSettings(ofs); ofs.close(); - } - -} \ No newline at end of file + } +} +