]> git.lyx.org Git - features.git/commitdiff
fix compilation on mac
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 2 Oct 2007 07:51:25 +0000 (07:51 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 2 Oct 2007 07:51:25 +0000 (07:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20653 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiMenubar.cpp
src/frontends/qt4/GuiMenubar.h

index 0bfd6a2fd6dc3a70a118980a8f9f53c7bd2b2a1a..e383254cdb5b06e238db15eb203cd8cdc3aeb484 100644 (file)
@@ -96,6 +96,12 @@ GuiMenubar::GuiMenubar(LyXView * view, MenuBackend & mbe)
 }
 
 
+GuiMenubar::~GuiMenubar() {
+#ifdef Q_WS_MACX
+       delete mac_menubar_;
+#endif
+}
+
 void GuiMenubar::openByName(QString const & name)
 {
        if (QMenu * menu = name_map_.value(name))
@@ -142,7 +148,7 @@ extern void qt_mac_set_menubar_merge(bool b);
 void GuiMenubar::macxMenuBarInit()
 {
 #ifdef Q_WS_MACX
-       mac_menubar_.reset(new QMenuBar);
+       mac_menubar_ = new QMenuBar;
 
 # if QT_VERSION >= 0x040200
        /* Since Qt 4.2, the qt/mac menu code has special code for
@@ -198,8 +204,9 @@ void GuiMenubar::macxMenuBarInit()
        Menu::const_iterator cit = menubackend_.specialMenu().begin();
        Menu::const_iterator end = menubackend_.specialMenu().end();
        for (size_t i = 0 ; cit != end ; ++cit, ++i) {
-               Action * action = new Action(*owner_, cit->label(),
-                                            cit->func());
+               Action * action = new Action(*owner_, QString(), 
+                                            toqstr(cit->label()),
+                                            cit->func(), QString());
                action->setMenuRole(entries[i].role);
                qMenu->addAction(action);
 
index dbcb632d9063c52461bc0e4efc38c1913e85b50c..1256fff0ceb3095b226e18e786759dfa8cfeac0f 100644 (file)
@@ -34,6 +34,8 @@ class GuiMenubar : public QObject
 public:
        GuiMenubar(LyXView *, MenuBackend &);
 
+       ~GuiMenubar();
+
        /// opens a top-level submenu given its name
        void openByName(QString const & name);