]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/menubar.cxx
Don't crash if built with --disable-atcdcl
[flightgear.git] / src / GUI / menubar.cxx
index 51ce861ea7a2276d4160e3b8b3eb2bea2ac62c7d..89246a5ede79a1a6c68478c7af8aa4748a6be86e 100644 (file)
@@ -6,8 +6,8 @@
 #include <iostream>
 #include <plib/pu.h>
 #include <simgear/debug/logstream.hxx>
+#include <simgear/structure/SGBinding.hxx>
 
-#include <Input/input.hxx>
 #include <Main/globals.hxx>
 
 #include "new_gui.hxx"
 // user-configured dialogs and new commands where necessary.
 ////////////////////////////////////////////////////////////////////////
 
-extern void reInit (puObject *);
-static bool
-do_reinit_dialog (const SGPropertyNode * arg)
-{
-    reInit(0);
-    return true;
-}
-
 #if defined(TR_HIRES_SNAP)
-extern void dumpHiResSnapShot (puObject *);
+extern void dumpHiResSnapShot ();
 static bool
 do_hires_snapshot_dialog (const SGPropertyNode * arg)
 {
-    dumpHiResSnapShot(0);
+    dumpHiResSnapShot();
     return true;
 }
 #endif // TR_HIRES_SNAP
 
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
-extern void printScreen (puObject *);
+#if defined( _WIN32 ) && !defined(__MINGW32__)
+extern void printScreen ();
 static bool
 do_print_dialog (const SGPropertyNode * arg)
 {
-    printScreen(0);
+    printScreen();
     return true;
 }
 #endif
 
-extern void helpCb (puObject *);
+extern void helpCb ();
 static bool
 do_help_dialog (const SGPropertyNode * arg)
 {
-    helpCb(0);
+    helpCb();
     return true;
 }
 
@@ -66,11 +58,10 @@ static struct {
     const char * name;
     SGCommandMgr::command_t command;
 } deprecated_dialogs [] = {
-    { "old-reinit-dialog", do_reinit_dialog },
 #if defined(TR_HIRES_SNAP)
     { "old-hires-snapshot-dialog", do_hires_snapshot_dialog },
 #endif
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
+#if defined( _WIN32 ) && !defined(__MINGW32__)
     { "old-print-dialog", do_print_dialog },
 #endif
     { "old-help-dialog", do_help_dialog },
@@ -267,7 +258,7 @@ FGMenuBar::destroy_menubar ()
                                 // Delete all the character arrays
                                 // we were forced to keep around for
                                 // plib.
-    SG_LOG(SG_GENERAL, SG_INFO, "Deleting char arrays");
+    SG_LOG(SG_GENERAL, SG_BULK, "Deleting char arrays");
     for (i = 0; i < _char_arrays.size(); i++) {
         for (int j = 0; _char_arrays[i][j] != 0; j++)
             free(_char_arrays[i][j]); // added with strdup
@@ -277,21 +268,20 @@ FGMenuBar::destroy_menubar ()
                                 // Delete all the callback arrays
                                 // we were forced to keep around for
                                 // plib.
-    SG_LOG(SG_GENERAL, SG_INFO, "Deleting callback arrays");
+    SG_LOG(SG_GENERAL, SG_BULK, "Deleting callback arrays");
     for (i = 0; i < _callback_arrays.size(); i++)
         delete[] _callback_arrays[i];
 
                                 // Delete all those bindings
-    SG_LOG(SG_GENERAL, SG_INFO, "Deleting bindings");
+    SG_LOG(SG_GENERAL, SG_BULK, "Deleting bindings");
     map<string,vector<SGBinding *> >::iterator it;
-    it = _bindings.begin();
     for (it = _bindings.begin(); it != _bindings.end(); it++) {
-        SG_LOG(SG_GENERAL, SG_INFO, "Deleting bindings for " << it->first);
+        SG_LOG(SG_GENERAL, SG_BULK, "Deleting bindings for " << it->first);
         for ( i = 0; i < it->second.size(); i++ )
             delete it->second[i];
     }
 
-    SG_LOG(SG_GENERAL, SG_INFO, "Done.");
+    SG_LOG(SG_GENERAL, SG_BULK, "Done.");
 }
 
 void
@@ -366,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 << '\'');