1
0
Fork 0

No longer recursively search $FG_ROOT/gui/dialogs/ for configuration

files; all of them must be at the top level.

Do not attempt to parse a configuration file unless it ends with
".xml".
This commit is contained in:
david 2003-01-24 02:43:52 +00:00
parent 7ef3bd5f6c
commit 8e659f84fa

View file

@ -140,6 +140,19 @@ NewGUI::clear ()
_dialog_props.clear();
}
static bool
test_extension (const char * path, const char * ext)
{
int pathlen = strlen(path);
int extlen = strlen(ext);
for (int i = 1; i <= pathlen && i <= extlen; i++) {
if (path[pathlen-i] != ext[extlen-i])
return false;
}
return true;
}
void
NewGUI::readDir (const char * path)
{
@ -159,10 +172,7 @@ NewGUI::readDir (const char * path)
ulMakePath(subpath, path, dirEnt->d_name);
if (dirEnt->d_isdir) {
if (dirEnt->d_name[0] != '.')
readDir(subpath);
} else {
if (!dirEnt->d_isdir && test_extension(subpath, ".xml")) {
SGPropertyNode * props = new SGPropertyNode;
try {
readProperties(subpath, props);