]> git.lyx.org Git - features.git/commitdiff
cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Fri, 7 Mar 2008 00:29:12 +0000 (00:29 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 7 Mar 2008 00:29:12 +0000 (00:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23528 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/Menus.cpp
src/frontends/qt4/Menus.h

index b3d3b872ee4883ed0910b4b7acc2fe40c8c1119c..00114bfe88f9367e6b098585c4c44ed8dd0838f8 100644 (file)
@@ -209,7 +209,7 @@ void Menus::macxMenuBarInit(GuiView * view)
                 QAction::ApplicationSpecificRole},
                {LFUN_LYX_QUIT, "", "Quit LyX", QAction::QuitRole}
        };
-       const size_t num_entries = sizeof(entries) / sizeof(MacMenuEntry);
+       const size_t num_entries = sizeof(entries) / sizeof(entries[0]);
 
        // the special menu for Menus.
        Menu special;
@@ -218,15 +218,14 @@ void Menus::macxMenuBarInit(GuiView * view)
                                       from_utf8(entries[i].arg));
                special.add(MenuItem(MenuItem::Command, entries[i].label, func));
        }
-       specialMenu(special);
+       setSpecialMenu(special);
 
        // add the entries to a QMenu that will eventually be empty
        // and therefore invisible.
        QMenu * qMenu = view->menuBar()->addMenu("special");
 
        // we do not use 'special' because it is a temporary variable,
-       // whereas Menus::specialMenu points to a persistent
-       // copy.
+       // whereas Menus::specialMenu points to a persistent copy.
        Menu::const_iterator cit = specialMenu().begin();
        Menu::const_iterator end = specialMenu().end();
        for (size_t i = 0 ; cit != end ; ++cit, ++i) {
@@ -234,7 +233,6 @@ void Menus::macxMenuBarInit(GuiView * view)
                                             cit->func(), QString());
                action->setMenuRole(entries[i].role);
                qMenu->addAction(action);
-
        }
 }
 
@@ -302,14 +300,7 @@ QString MenuItem::binding() const
 }
 
 
-Menu & Menu::add(MenuItem const & i)
-{
-       items_.push_back(i);
-       return *this;
-}
-
-
-Menu & Menu::addWithStatusCheck(MenuItem const & i)
+void Menu::addWithStatusCheck(MenuItem const & i)
 {
        switch (i.kind()) {
 
@@ -352,12 +343,10 @@ Menu & Menu::addWithStatusCheck(MenuItem const & i)
        default:
                items_.push_back(i);
        }
-
-       return *this;
 }
 
 
-Menu & Menu::read(Lexer & lex)
+void Menu::read(Lexer & lex)
 {
        enum Menutags {
                md_item = 1,
@@ -526,7 +515,6 @@ Menu & Menu::read(Lexer & lex)
                }
        }
        lex.popTable();
-       return *this;
 }
 
 
@@ -591,12 +579,6 @@ bool Menu::searchMenu(FuncRequest const & func, vector<docstring> & names) const
 }
 
 
-void Menus::specialMenu(Menu const & menu)
-{
-       specialmenu_ = menu;
-}
-
-
 namespace {
 
 bool compareFormat(Format const * p1, Format const * p2)
index c20eccbd821487d75441678b56fdd7998160bc89..0b7d1a92f638f256e84da45e4d6aafcbb1929122 100644 (file)
@@ -167,12 +167,12 @@ public:
        explicit Menu(QString const & name = QString()) : name_(name) {}
 
        /// Add the menu item unconditionally
-       Menu & add(MenuItem const &);
+       void add(MenuItem const & item) { items_.push_back(item); }
        /// Checks the associated FuncRequest status before adding the
        /// menu item.
-       Menu & addWithStatusCheck(MenuItem const &);
+       void addWithStatusCheck(MenuItem const &);
        ///
-       Menu & read(Lexer &);
+       void read(Lexer &);
        ///
        QString const & name() const { return name_; }
        ///
@@ -246,7 +246,7 @@ public:
            that will be removed by expand() in other menus. This is
            used by the Qt/Mac code
        */
-       void specialMenu(Menu const &);
+       void setSpecialMenu(Menu const & menu) { specialmenu_ = menu; }
        ///
        Menu const & specialMenu() { return specialmenu_; }