]> git.stg.codes - stg.git/blobdiff - projects/stargazer/settings_impl.cpp
Merge branch 'master' into full-month-stats
[stg.git] / projects / stargazer / settings_impl.cpp
index 33b3e840c2ac7437de49bbe81b048848d2fdc768..d197efc40c32877bf1852982b2f34a8df7a15d93 100644 (file)
@@ -40,7 +40,8 @@ using namespace std;
 
 //-----------------------------------------------------------------------------
 SETTINGS_IMPL::SETTINGS_IMPL()
-    : strError(),
+    : SETTINGS(),
+      strError(),
       modulesPath("/usr/lib/stg"),
       dirName(DIR_NUM),
       confDir("/etc/stargazer"),
@@ -64,6 +65,7 @@ SETTINGS_IMPL::SETTINGS_IMPL()
       showFeeInCash(true),
       messageTimeout(0),
       feeChargeType(0),
+      reconnectOnTariffChange(false),
       modulesSettings(),
       storeModuleSettings(),
       logger(GetStgLogger())
@@ -71,7 +73,8 @@ SETTINGS_IMPL::SETTINGS_IMPL()
 }
 //-----------------------------------------------------------------------------
 SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd)
-    : strError(),
+    : SETTINGS(),
+      strError(),
       modulesPath("/usr/lib/stg"),
       dirName(DIR_NUM),
       confDir(cd),
@@ -95,6 +98,7 @@ SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd)
       showFeeInCash(true),
       messageTimeout(0),
       feeChargeType(0),
+      reconnectOnTariffChange(false),
       modulesSettings(),
       storeModuleSettings(),
       logger(GetStgLogger())
@@ -102,7 +106,8 @@ SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd)
 }
 //-----------------------------------------------------------------------------
 SETTINGS_IMPL::SETTINGS_IMPL(const SETTINGS_IMPL & rval)
-    : strError(),
+    : SETTINGS(),
+      strError(),
       modulesPath(rval.modulesPath),
       dirName(rval.dirName),
       confDir(rval.confDir),
@@ -126,6 +131,7 @@ SETTINGS_IMPL::SETTINGS_IMPL(const SETTINGS_IMPL & rval)
       showFeeInCash(rval.showFeeInCash),
       messageTimeout(rval.messageTimeout),
       feeChargeType(rval.feeChargeType),
+      reconnectOnTariffChange(rval.reconnectOnTariffChange),
       modulesSettings(rval.modulesSettings),
       storeModuleSettings(rval.storeModuleSettings),
       logger(GetStgLogger())
@@ -441,6 +447,15 @@ while (node)
             }
         }
 
+    if (strcasecmp(node->getName(), "ReconnectOnTariffChange") == 0)
+        {
+        if (ParseYesNo(node->getValue(0), &reconnectOnTariffChange) != 0)
+            {
+            strError = "Incorrect ReconnectOnTariffChange value: \'" + string(node->getValue(0)) + "\'";
+            return -1;
+            }
+        }
+
     if (strcasecmp(node->getName(), "DirNames") == 0)
         {
         const DOTCONFDocumentNode * child = node->getChildNode();