diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index 8c5532db1..de107a682 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -226,7 +226,7 @@ void FGAIBase::initModel(osg::Node *node) { if (model.valid()) { - fgSetString("/ai/models/model-added", props->getPath()); + fgSetString("/ai/models/model-added", props->getPath().c_str()); } else if (!model_path.empty()) { SG_LOG(SG_INPUT, SG_WARN, "AIBase: Could not load model " << model_path); diff --git a/src/GUI/menubar.cxx b/src/GUI/menubar.cxx index d34f0fe3a..89246a5ed 100644 --- a/src/GUI/menubar.cxx +++ b/src/GUI/menubar.cxx @@ -356,7 +356,7 @@ FGMenuBar::add_enabled_listener(SGPropertyNode * node) bool FGMenuBar::enable_item(const SGPropertyNode * node, bool state) { - const char *path = node->getPath(); + string path = node->getPath(); if (_objects.find(path) == _objects.end()) { SG_LOG(SG_GENERAL, SG_ALERT, "Trying to enable/disable " "non-existent menu item for node `" << path << '\''); diff --git a/src/GUI/property_list.hxx b/src/GUI/property_list.hxx index beeaeda22..046c09435 100644 --- a/src/GUI/property_list.hxx +++ b/src/GUI/property_list.hxx @@ -23,6 +23,7 @@ #ifndef _PROPERTY_LIST_HXX #define _PROPERTY_LIST_HXX +#include #include #include @@ -41,7 +42,13 @@ public: void toggleVerbosity() { _verbose = !_verbose; } // overridden plib pui methods - virtual char *getStringValue(void) { return (char *)(_return ? _return->getPath(true) : ""); } + virtual char *getStringValue(void) + { + _return_path.clear(); + if (_return) + _return_path = _return->getPath(true); + return const_cast(_return_path.c_str()); + } //virtual char *getListStringValue() { return (char *)(_return ? _return->getPath(true) : ""); } virtual void setValue(const char *); @@ -81,6 +88,7 @@ private: bool _dot_files; // . and .. pseudo-dirs currently shown? bool _verbose; // show SGPropertyNode flags + std::string _return_path; }; diff --git a/src/Instrumentation/gps.cxx b/src/Instrumentation/gps.cxx index 2f7455b83..e05805d83 100644 --- a/src/Instrumentation/gps.cxx +++ b/src/Instrumentation/gps.cxx @@ -222,7 +222,7 @@ GPS::Config::getCourseSource() const return ""; } - return _extCourseSource->getPath(true); + return _extCourseSource->getPath(true).c_str(); } void diff --git a/src/Main/logger.cxx b/src/Main/logger.cxx index 95e0a5dbe..2a4561c73 100644 --- a/src/Main/logger.cxx +++ b/src/Main/logger.cxx @@ -93,7 +93,7 @@ FGLogger::init () fgGetNode(entry->getStringValue("property"), true); log.nodes.push_back(node); (*log.output) << log.delimiter - << entry->getStringValue("title", node->getPath()); + << entry->getStringValue("title", node->getPath().c_str()); } (*log.output) << endl; } diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index dc8b0d434..a210d0356 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -759,7 +759,7 @@ void FGNasalSys::loadPropertyScripts() const char* src = n->getStringValue("script"); if(!n->hasChild("script")) src = 0; // Hrm... if(src) - createModule(module, n->getPath(), src, strlen(src)); + createModule(module, n->getPath().c_str(), src, strlen(src)); if(!file_specified && !src) SG_LOG(SG_NASAL, SG_ALERT, "Nasal error: " << @@ -856,7 +856,7 @@ bool FGNasalSys::handleCommand(const SGPropertyNode* arg) { const char* nasal = arg->getStringValue("script"); const char* moduleName = arg->getStringValue("module"); - naRef code = parse(arg->getPath(true), nasal, strlen(nasal)); + naRef code = parse(arg->getPath(true).c_str(), nasal, strlen(nasal)); if(naIsNil(code)) return false; // Commands can be run "in" a module. Make sure that module