Fix crash when the Gui Name of a toolbar is not plain ascii. This

happens for example with fr.po. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26176 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-08-15 18:43:46 +00:00
parent 7706b59c00
commit d0827e017e
4 changed files with 5 additions and 5 deletions

View File

@ -679,7 +679,7 @@ void GuiLayoutBox::selected(int index)
GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner)
: QToolBar(qt_(tbinfo.gui_name), &owner), visibility_(0),
: QToolBar(toqstr(tbinfo.gui_name), &owner), visibility_(0),
allowauto_(false), owner_(owner), layout_(0), command_buffer_(0),
tbinfo_(tbinfo), filled_(false)
{

View File

@ -1010,7 +1010,7 @@ void MenuDefinition::expandToolbars()
Toolbars::Infos::const_iterator cit = guiApp->toolbars().begin();
Toolbars::Infos::const_iterator end = guiApp->toolbars().end();
for (; cit != end; ++cit) {
MenuItem const item(MenuItem::Command, qt_(cit->gui_name),
MenuItem const item(MenuItem::Command, toqstr(cit->gui_name),
FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name));
if (guiApp->toolbars().isMainToolbar(cit->name))
add(item);

View File

@ -95,7 +95,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
name = lex.getString();
lex.next(true);
gui_name = fromqstr(qt_(lex.getString()));
gui_name = _(lex.getString());
// FIXME what to do here?
if (!lex) {
@ -306,7 +306,7 @@ void Toolbars::readToolbarSettings(Lexer & lex)
if (visibility >= MATH) {
if (ToolbarInfo const * ti = info(name))
const_cast<ToolbarInfo *>(ti)->gui_name +=
fromqstr(" (" + qt_("auto") + ")");
" (" + _("auto") + ")";
}
}
}

View File

@ -77,7 +77,7 @@ public:
/// toolbar name
std::string name;
/// toolbar GUI name
std::string gui_name;
docstring gui_name;
/// toolbar contents
Items items;