]> git.lyx.org Git - features.git/commitdiff
Cosmetics.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 24 May 2008 09:51:17 +0000 (09:51 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 24 May 2008 09:51:17 +0000 (09:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24923 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiApplication.h

index 9a6191a830cb1eb38fa1671408ae16f60a6f44c4..a4e4cc5895c5d11eafb9986e143c1560f71a118e 100644 (file)
@@ -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<docstring> & 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<string> uifiles;
-       list<string>::const_iterator it  = uifiles.begin();
-       list<string>::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;
index cafa489436a34dfbbaa291417975e9dd8f3276fb..d02dbfe1e27475a871af80d9b5ba89a7c8d2080e 100644 (file)
@@ -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