X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/793728a58d8f97daf7de1dde7a02a5c4a30e30d4..0c80dbc4ce66a278eb5235420d34a469323efc6b:/projects/stargazer/plugins/store/files/file_store.cpp diff --git a/projects/stargazer/plugins/store/files/file_store.cpp b/projects/stargazer/plugins/store/files/file_store.cpp index 0f55b530..0466b824 100644 --- a/projects/stargazer/plugins/store/files/file_store.cpp +++ b/projects/stargazer/plugins/store/files/file_store.cpp @@ -1483,6 +1483,11 @@ else printfd(__FILE__, "FILES_STORE::RestoreTariff - invalid trafftype for tariff '%s'\n", tariffName.c_str()); return -1; } + +if (conf.ReadString("Period", &str, "month") < 0) + td->tariffConf.period = TARIFF::MONTH; +else + td->tariffConf.period = TARIFF::StringToPeriod(str); return 0; } //----------------------------------------------------------------------------- @@ -1558,6 +1563,8 @@ std::string fileName = storeSettings.GetTariffsDir() + "/" + tariffName + ".tf"; cf.WriteString("TraffType", "max"); break; } + + cf.WriteString("Period", TARIFF::PeriodToString(td.tariffConf.period)); } return 0; @@ -1851,7 +1858,7 @@ if (rename((fileName + ".new").c_str(), fileName.c_str()) < 0) { STG_LOCKER lock(&mutex, __FILE__, __LINE__); errorStr = "Error moving dir from " + fileName + ".new to " + fileName; - printfd(__FILE__, "FILES_STORE::SaveTariff - rename failed. Message: '%s'\n", strerror(errno)); + printfd(__FILE__, "FILES_STORE::EditMessage - rename failed. Message: '%s'\n", strerror(errno)); return -1; }