From 522c6248219c9712090f2ddcd7cd79e928a1a32f Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 2 Oct 2007 07:51:25 +0000 Subject: [PATCH] fix compilation on mac git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20653 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiMenubar.cpp | 13 ++++++++++--- src/frontends/qt4/GuiMenubar.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiMenubar.cpp b/src/frontends/qt4/GuiMenubar.cpp index 0bfd6a2fd6..e383254cdb 100644 --- a/src/frontends/qt4/GuiMenubar.cpp +++ b/src/frontends/qt4/GuiMenubar.cpp @@ -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); diff --git a/src/frontends/qt4/GuiMenubar.h b/src/frontends/qt4/GuiMenubar.h index dbcb632d90..1256fff0ce 100644 --- a/src/frontends/qt4/GuiMenubar.h +++ b/src/frontends/qt4/GuiMenubar.h @@ -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); -- 2.39.2