]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Config/Config_XMLReader.cpp
Salome HOME
Fix the SHAPER version of resources
[modules/shaper.git] / src / Config / Config_XMLReader.cpp
index 0f36a154867dc7635377ef82d6d840492743a6b1..184fcdf61fa1656a7b395cf0d8ed6c0095f1b82c 100644 (file)
 #include <iostream>
 #endif
 
+#ifdef WIN32
+    static const char FSEP = '\\';
+#else
+    static const char FSEP = '/';
+#endif
+
 Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
     : myXmlDoc(NULL)
 {
@@ -43,12 +49,7 @@ Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
   if (prefix.empty())
     prefix = pluginConfigFile();
 
-#ifdef WIN32
-    prefix += "\\";
-#else
-    prefix += "/";
-#endif
-  myDocumentPath = prefix + theXmlFileName;
+  myDocumentPath = prefix + FSEP + theXmlFileName;
   std::ifstream aTestFile(myDocumentPath);
   if (!aTestFile) Events_Error::send("Unable to open " + myDocumentPath);
   aTestFile.close();
@@ -64,18 +65,14 @@ std::string Config_XMLReader::pluginConfigFile()
   std::string aValue;
   char* anEnv = getenv("SHAPER_ROOT_DIR");
   if (anEnv) {
-    aValue = std::string(anEnv);
+    aValue = std::string(anEnv) +
+      FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
   } else {
     anEnv = getenv("OPENPARTS_ROOT_DIR");
-    if (anEnv)
-      aValue = std::string(anEnv);
+    if (anEnv) {
+      aValue = std::string(anEnv) + FSEP + "plugins";
+    }
   }
-#ifdef WIN32
-    aValue += "\\";
-#else
-    aValue += "/";
-#endif
-  aValue += "plugins";
   return aValue;
 }