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;
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) {
cit->func(), QString());
action->setMenuRole(entries[i].role);
qMenu->addAction(action);
-
}
}
}
-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()) {
default:
items_.push_back(i);
}
-
- return *this;
}
-Menu & Menu::read(Lexer & lex)
+void Menu::read(Lexer & lex)
{
enum Menutags {
md_item = 1,
}
}
lex.popTable();
- return *this;
}
}
-void Menus::specialMenu(Menu const & menu)
-{
- specialmenu_ = menu;
-}
-
-
namespace {
bool compareFormat(Format const * p1, Format const * p2)
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_; }
///
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_; }