Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Features and plugins loading mechanisms
[modules/shaper.git]
/
src
/
Config
/
Config_XMLReader.cpp
diff --git
a/src/Config/Config_XMLReader.cpp
b/src/Config/Config_XMLReader.cpp
index 89f0d46fcd40d60665bee539f3f356f4c0131033..1b206af8223add70ded12b6f69ca69a619f8d4f2 100644
(file)
--- a/
src/Config/Config_XMLReader.cpp
+++ b/
src/Config/Config_XMLReader.cpp
@@
-11,10
+11,12
@@
#include <libxml\parser.h>
#include <libxml\tree.h>
#include <libxml\parser.h>
#include <libxml\tree.h>
+/*
#ifdef WIN32
//For GetModuleFileNameW
#include <windows.h>
#endif
#ifdef WIN32
//For GetModuleFileNameW
#include <windows.h>
#endif
+*/
#ifdef _DEBUG
#include <iostream>
#ifdef _DEBUG
#include <iostream>
@@
-23,6
+25,8
@@
Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
{
std::string prefix;
Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
{
std::string prefix;
+ /* the problem: application may be launched using python execuable, to use environment variable
+ (at least for the current moment)
//Get path to *.xml files (typically ./bin/../plugins/)
#ifdef WIN32
HMODULE hModule = GetModuleHandleW(NULL);
//Get path to *.xml files (typically ./bin/../plugins/)
#ifdef WIN32
HMODULE hModule = GetModuleHandleW(NULL);
@@
-40,6
+44,11
@@
Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
//TODO(sbh): Find full path to binary on linux
prefix = "../plugins/";
#endif
//TODO(sbh): Find full path to binary on linux
prefix = "../plugins/";
#endif
+ */
+ char* anEnv = getenv("NEW_GEOM_CONFIG_FILE");
+ if (anEnv) {
+ prefix = std::string(anEnv) + "/";
+ }
myDocumentPath = prefix + theXmlFileName;
}
myDocumentPath = prefix + theXmlFileName;
}
@@
-109,8
+118,6
@@
xmlNodePtr Config_XMLReader::findRoot()
*/
void Config_XMLReader::readRecursively(xmlNodePtr theParent)
{
*/
void Config_XMLReader::readRecursively(xmlNodePtr theParent)
{
- static Event_ID aFeatureEvent = Event_Loop::EventByName("Feature");
-
if (!theParent)
return;
xmlNodePtr aNode = theParent->xmlChildrenNode;
if (!theParent)
return;
xmlNodePtr aNode = theParent->xmlChildrenNode;
@@
-118,7
+125,6
@@
void Config_XMLReader::readRecursively(xmlNodePtr theParent)
processNode(aNode);
if (processChildren(aNode)) {
readRecursively(aNode);
processNode(aNode);
if (processChildren(aNode)) {
readRecursively(aNode);
- Config_FeatureMessage aMessage(aFeatureEvent, this);
}
}
}
}
}
}