Merge branch 'timoore/getpath-rebase' into next
This commit is contained in:
commit
7ee645aa20
6 changed files with 15 additions and 7 deletions
|
@ -226,7 +226,7 @@ void FGAIBase::initModel(osg::Node *node)
|
||||||
{
|
{
|
||||||
if (model.valid()) {
|
if (model.valid()) {
|
||||||
|
|
||||||
fgSetString("/ai/models/model-added", props->getPath());
|
fgSetString("/ai/models/model-added", props->getPath().c_str());
|
||||||
|
|
||||||
} else if (!model_path.empty()) {
|
} else if (!model_path.empty()) {
|
||||||
SG_LOG(SG_INPUT, SG_WARN, "AIBase: Could not load model " << model_path);
|
SG_LOG(SG_INPUT, SG_WARN, "AIBase: Could not load model " << model_path);
|
||||||
|
|
|
@ -356,7 +356,7 @@ FGMenuBar::add_enabled_listener(SGPropertyNode * node)
|
||||||
bool
|
bool
|
||||||
FGMenuBar::enable_item(const SGPropertyNode * node, bool state)
|
FGMenuBar::enable_item(const SGPropertyNode * node, bool state)
|
||||||
{
|
{
|
||||||
const char *path = node->getPath();
|
string path = node->getPath();
|
||||||
if (_objects.find(path) == _objects.end()) {
|
if (_objects.find(path) == _objects.end()) {
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "Trying to enable/disable "
|
SG_LOG(SG_GENERAL, SG_ALERT, "Trying to enable/disable "
|
||||||
"non-existent menu item for node `" << path << '\'');
|
"non-existent menu item for node `" << path << '\'');
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#ifndef _PROPERTY_LIST_HXX
|
#ifndef _PROPERTY_LIST_HXX
|
||||||
#define _PROPERTY_LIST_HXX
|
#define _PROPERTY_LIST_HXX
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <plib/puAux.h>
|
#include <plib/puAux.h>
|
||||||
#include <simgear/props/props.hxx>
|
#include <simgear/props/props.hxx>
|
||||||
|
@ -41,7 +42,13 @@ public:
|
||||||
void toggleVerbosity() { _verbose = !_verbose; }
|
void toggleVerbosity() { _verbose = !_verbose; }
|
||||||
|
|
||||||
// overridden plib pui methods
|
// 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<char*>(_return_path.c_str());
|
||||||
|
}
|
||||||
//virtual char *getListStringValue() { return (char *)(_return ? _return->getPath(true) : ""); }
|
//virtual char *getListStringValue() { return (char *)(_return ? _return->getPath(true) : ""); }
|
||||||
virtual void setValue(const char *);
|
virtual void setValue(const char *);
|
||||||
|
|
||||||
|
@ -81,6 +88,7 @@ private:
|
||||||
|
|
||||||
bool _dot_files; // . and .. pseudo-dirs currently shown?
|
bool _dot_files; // . and .. pseudo-dirs currently shown?
|
||||||
bool _verbose; // show SGPropertyNode flags
|
bool _verbose; // show SGPropertyNode flags
|
||||||
|
std::string _return_path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ GPS::Config::getCourseSource() const
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return _extCourseSource->getPath(true);
|
return _extCourseSource->getPath(true).c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -93,7 +93,7 @@ FGLogger::init ()
|
||||||
fgGetNode(entry->getStringValue("property"), true);
|
fgGetNode(entry->getStringValue("property"), true);
|
||||||
log.nodes.push_back(node);
|
log.nodes.push_back(node);
|
||||||
(*log.output) << log.delimiter
|
(*log.output) << log.delimiter
|
||||||
<< entry->getStringValue("title", node->getPath());
|
<< entry->getStringValue("title", node->getPath().c_str());
|
||||||
}
|
}
|
||||||
(*log.output) << endl;
|
(*log.output) << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -759,7 +759,7 @@ void FGNasalSys::loadPropertyScripts()
|
||||||
const char* src = n->getStringValue("script");
|
const char* src = n->getStringValue("script");
|
||||||
if(!n->hasChild("script")) src = 0; // Hrm...
|
if(!n->hasChild("script")) src = 0; // Hrm...
|
||||||
if(src)
|
if(src)
|
||||||
createModule(module, n->getPath(), src, strlen(src));
|
createModule(module, n->getPath().c_str(), src, strlen(src));
|
||||||
|
|
||||||
if(!file_specified && !src)
|
if(!file_specified && !src)
|
||||||
SG_LOG(SG_NASAL, SG_ALERT, "Nasal error: " <<
|
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* nasal = arg->getStringValue("script");
|
||||||
const char* moduleName = arg->getStringValue("module");
|
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;
|
if(naIsNil(code)) return false;
|
||||||
|
|
||||||
// Commands can be run "in" a module. Make sure that module
|
// Commands can be run "in" a module. Make sure that module
|
||||||
|
|
Loading…
Add table
Reference in a new issue