]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Menus.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / Menus.cpp
index 9175d23cff0ac5e7ceada96c87d1996f3c54ed09..fd4884f54b1f650a3a3c07c548590fc190982fe4 100644 (file)
@@ -37,7 +37,7 @@ void Menus::fillMenuBar(GuiView * view)
        
 #ifdef Q_WS_MACX
        // setup special mac specific menu item
-       macxMenuBarInit();
+       macxMenuBarInit(view);
 #endif
 
        LYXERR(Debug::GUI, "populating menu bar" << to_utf8(getMenubar().name()));
@@ -75,9 +75,6 @@ void Menus::fillMenuBar(GuiView * view)
                        continue;
                }
 
-               Menu menu;
-               expand(getMenubar(), menu, view->buffer());
-
                GuiPopupMenu * qMenu = new GuiPopupMenu(view, *m, true);
                view->menuBar()->addMenu(qMenu);
 
@@ -124,6 +121,12 @@ QMenu * Menus::menu(QString const & name)
 
 void Menus::macxMenuBarInit(GuiView * view)
 {
+       // The Mac menubar initialisation must be done only once!
+       static bool done = false;
+       if (done)
+               return;
+       done = true;
+
        /* Since Qt 4.2, the qt/mac menu code has special code for
           specifying the role of a menu entry. However, it does not
           work very well with our scheme of creating menus on demand,