From 4e02ad6c394e407ed532da55a141605681f312c4 Mon Sep 17 00:00:00 2001 From: Naffanya Date: Sat, 5 Apr 2014 01:01:40 +0300 Subject: [PATCH 1/1] Move abbility get value 'tarrif' from parameter's name 'tarrifName' to GetParamValue --- projects/stargazer/plugins/other/rscript/rscript.cpp | 6 +----- projects/stargazer/user_impl.cpp | 1 + projects/stargazer/user_property.cpp | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/projects/stargazer/plugins/other/rscript/rscript.cpp index 7a0605a2..e781a8cb 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.cpp +++ b/projects/stargazer/plugins/other/rscript/rscript.cpp @@ -429,11 +429,7 @@ for(it = rsSettings.GetUserParams().begin(); it != rsSettings.GetUserParams().end(); ++it) { - std::string parameter; - if (*it == "tariffName") - parameter = rsu.user->GetParamValue("tariff"); - else - parameter = rsu.user->GetParamValue(*it); + std::string parameter(rsu.user->GetParamValue(it->c_str())); if (params.length() + parameter.length() > RS_PARAMS_LEN - 1) { logger("Script params string length %d exceeds the limit of %d symbols.", params.length() + parameter.length(), RS_PARAMS_LEN); diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index f15b182a..30a3c171 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1521,6 +1521,7 @@ std::string USER_IMPL::GetParamValue(const std::string & name) const if (lowerName == "login") return login; if (lowerName == "currip") return currIP.ToString(); if (lowerName == "enableddirs") return GetEnabledDirs(); + if (lowerName == "tariffname") return property.GetPropertyValue("tarrif"); if (property.Exists(lowerName)) return property.GetPropertyValue(lowerName); else diff --git a/projects/stargazer/user_property.cpp b/projects/stargazer/user_property.cpp index 821b3ba3..feef2e59 100644 --- a/projects/stargazer/user_property.cpp +++ b/projects/stargazer/user_property.cpp @@ -18,7 +18,7 @@ USER_PROPERTIES::USER_PROPERTIES(const std::string & sd) disabledDetailStat(conf.disabledDetailStat, "DisabledDetailStat", false, false, GetStgLogger(), sd, properties), alwaysOnline(conf.alwaysOnline, "alwaysOnline", false, false, GetStgLogger(), sd, properties), tariffName (conf.tariffName, "tariff", false, false, GetStgLogger(), sd, properties), - nextTariff (conf.nextTariff, "next tariff", false, false, GetStgLogger(), sd, properties), + nextTariff (conf.nextTariff, "nextTariff", false, false, GetStgLogger(), sd, properties), address (conf.address, "address", false, false, GetStgLogger(), sd, properties), note (conf.note, "note", false, false, GetStgLogger(), sd, properties), group (conf.group, "group", false, false, GetStgLogger(), sd, properties), -- 2.44.2