From: Abdelrazak Younes Date: Sat, 24 May 2008 09:51:17 +0000 (+0000) Subject: Cosmetics. X-Git-Tag: 1.6.10~4690 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f46e57afa080a9b7a95fa92a225c14f2ed417d6e;p=features.git Cosmetics. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24923 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 9a6191a830..a4e4cc5895 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -752,7 +752,7 @@ void GuiApplication::exit(int status) void GuiApplication::execBatchCommands() { // Read menus - if (!readUIFile(lyxrc.ui_file)) + if (!readUIFile(toqstr(lyxrc.ui_file))) // Gives some error box here. return; @@ -1038,11 +1038,11 @@ Buffer const * GuiApplication::updateInset(Inset const * inset) const bool GuiApplication::searchMenu(FuncRequest const & func, vector & names) const { - return menus().searchMenu(func, names); + return d->menus_.searchMenu(func, names); } -bool GuiApplication::readUIFile(string const & name, bool include) +bool GuiApplication::readUIFile(QString const & name, bool include) { enum { ui_menuset = 1, @@ -1060,11 +1060,8 @@ bool GuiApplication::readUIFile(string const & name, bool include) }; // Ensure that a file is read only once (prevents include loops) - static list uifiles; - list::const_iterator it = uifiles.begin(); - list::const_iterator end = uifiles.end(); - it = find(it, end, name); - if (it != end) { + static QStringList uifiles; + if (uifiles.contains(name)) { LYXERR(Debug::INIT, "UI file '" << name << "' has been read already. " << "Is this an include loop?"); return false; @@ -1072,22 +1069,20 @@ bool GuiApplication::readUIFile(string const & name, bool include) LYXERR(Debug::INIT, "About to read " << name << "..."); - FileName ui_path; if (include) { - ui_path = libFileSearch("ui", toqstr(name), "inc"); + ui_path = libFileSearch("ui", name, "inc"); if (ui_path.empty()) - ui_path = libFileSearch("ui", - changeExtension(toqstr(name), "inc")); + ui_path = libFileSearch("ui", changeExtension(name, "inc")); + } else { + ui_path = libFileSearch("ui", name, "ui"); } - else - ui_path = libFileSearch("ui", toqstr(name), "ui"); if (ui_path.empty()) { LYXERR(Debug::INIT, "Could not find " << name); Alert::warning(_("Could not find UI defintion file"), bformat(_("Error while reading the configuration file\n%1$s.\n" - "Please check your installation."), from_utf8(name))); + "Please check your installation."), qstring_to_ucs4(name))); return false; } @@ -1108,7 +1103,7 @@ bool GuiApplication::readUIFile(string const & name, bool include) switch (lex.lex()) { case ui_include: { lex.next(true); - string const file = lex.getString(); + QString const file = toqstr(lex.getString()); if (!readUIFile(file, true)) return false; break; diff --git a/src/frontends/qt4/GuiApplication.h b/src/frontends/qt4/GuiApplication.h index cafa489436..d02dbfe1e2 100644 --- a/src/frontends/qt4/GuiApplication.h +++ b/src/frontends/qt4/GuiApplication.h @@ -127,7 +127,7 @@ private: /// bool closeAllViews(); /// read the given ui (menu/toolbar) file - bool readUIFile(std::string const & name, bool include = false); + bool readUIFile(QString const & name, bool include = false); /// This LyXView is the one receiving Clipboard and Selection /// events