]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToolbar.cpp
Fix the tab ordering of GuiDocument components.
[lyx.git] / src / frontends / qt4 / GuiToolbar.cpp
index 93ea4c75525ce68b0d252b8596217fba8db0b760..5a0edfa335419e3fe1557a0411f677517c498614 100644 (file)
@@ -174,11 +174,15 @@ MenuButton::MenuButton(GuiToolbar * bar, ToolbarItem const & item, bool const st
        setStatusTip(label);
        setText(label);
        QString const name = toqstr(tbitem_.name_);
-       FileName const fname = libFileSearch("images/math/", name, "png");
-       if (fname.exists())
-           setIcon(QIcon(getPixmap("images/math/", name, "png")));
-       else
-           setIcon(QIcon(getPixmap("images/", name, "png")));
+       QString imagedir = "images/math/";
+       FileName const fname = imageLibFileSearch(imagedir, name, "png");
+       if (fname.exists()) {
+               setIcon(QIcon(getPixmap(imagedir, name, "png")));
+       } else {
+               imagedir = "images/";
+               imageLibFileSearch(imagedir, name, "png");
+               setIcon(QIcon(getPixmap(imagedir, name, "png")));
+       }
        if (sticky)
                connect(this, SIGNAL(triggered(QAction *)),
                        this, SLOT(actionTriggered(QAction *)));
@@ -330,9 +334,8 @@ void GuiToolbar::restoreSession()
        int visibility =
                settings.value(sessionKey() + "/visibility", error_val).toInt();
        if (visibility == error_val || visibility == 0) {
-               // The settings have not been found. This can happen when
-               // the ui file has changed so that we use the settings from
-               // the new ui file rather than the old settings.
+               // This should not happen, but in case we use the defaults
+               LYXERR0("Session settings could not be found! Defaults are used instead.");
                visibility = 
                        guiApp->toolbars().defaultVisibility(fromqstr(objectName()));
        }