Salome HOME
Update SketchPlugin_Projection feature (issue #1459)
[modules/shaper.git] / src / Config / Config_XMLReader.cpp
index c08238a08de361d8ef55d9de14c91c5f64bb9df2..11b2c5890eb34708c28062d3038acc30585e477c 100644 (file)
@@ -40,12 +40,9 @@ Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
    * the problem: application may be launched using python executable,
    * to use environment variable (at least for the current moment)
    */
-  if (prefix.empty()) {
-    char* anEnv = getenv("PLUGINS_CONFIG_FILE");
-    if (anEnv) {
-      prefix = std::string(anEnv);
-    }
-  }
+  if (prefix.empty())
+    prefix = pluginConfigFile();
+
 #ifdef WIN32
     prefix += "\\";
 #else
@@ -62,6 +59,16 @@ Config_XMLReader::~Config_XMLReader()
   xmlFreeDoc(myXmlDoc);
 }
 
+std::string Config_XMLReader::pluginConfigFile()
+{
+  std::string aValue;
+  char* anEnv = getenv("PLUGINS_CONFIG_FILE");
+  if (anEnv) {
+    aValue = std::string(anEnv);
+  }
+  return aValue;
+}
+
 void Config_XMLReader::readAll()
 {
   xmlNodePtr aRoot = findRoot();