]> git.stg.codes - stg.git/commitdiff
Move abbility get value 'tarrif' from parameter's name 'tarrifName' to GetParamValue
authorNaffanya <naffanya@naffanya.(none)>
Fri, 4 Apr 2014 22:01:40 +0000 (01:01 +0300)
committerNaffanya <naffanya@naffanya.(none)>
Fri, 4 Apr 2014 22:01:40 +0000 (01:01 +0300)
projects/stargazer/plugins/other/rscript/rscript.cpp
projects/stargazer/user_impl.cpp
projects/stargazer/user_property.cpp

index 7a0605a2309d157891d7ed922182771566d70f4a..e781a8cb91532f3d976a5f9d5fdc478ff7586616 100644 (file)
@@ -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);
index f15b182aaaea9fc756f447209e48b2e6dc19334a..30a3c171941720787cb664cc47ec2ce4fac29728 100644 (file)
@@ -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
index 821b3ba366b3427fab201bb12573724309934dd3..feef2e598ab4ad39405036823601dd9b03d77a89 100644 (file)
@@ -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),