]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.cxx
Make sure that all elapsed time gets passed to update when a subsystem
[flightgear.git] / src / GUI / new_gui.cxx
index 4e06c320c417001b6dee772c855646fa9c3edef9..d5b86c2fc19afeb9a6fabda232c7dec07c020686 100644 (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);