]> git.lyx.org Git - features.git/commitdiff
avoid redundant toolbar initialization
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 20 Mar 2013 12:59:25 +0000 (13:59 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 20 Mar 2013 12:59:25 +0000 (13:59 +0100)
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index 08079a3e55002523124d137e4e05349825cb5ad7..66d3997862c1b076f0626ff5a7b0511e5ff97d7c 100644 (file)
@@ -501,10 +501,8 @@ GuiView::GuiView(int id)
 
        if (lyxrc.allow_geometry_session) {
                // Now take care of session management.
-               if (restoreLayout()) {
-                       initToolbars();
+               if (restoreLayout(true))
                        return;
-               }
        }
 
        // no session handling, default to a sane size.
@@ -625,7 +623,7 @@ void GuiView::saveUISettings() const
 }
 
 
-bool GuiView::restoreLayout()
+bool GuiView::restoreLayout(bool force_inittoolbars)
 {
        QSettings settings;
        settings.beginGroup("views");
@@ -674,7 +672,8 @@ bool GuiView::restoreLayout()
        if ((dialog = findOrBuild("findreplaceadv", true)))
                dialog->prepareView();
 
-       if (!restoreState(settings.value("layout").toByteArray(), 0))
+       if (!restoreState(settings.value("layout").toByteArray(), 0)
+           || force_inittoolbars)
                initToolbars();
        updateDialogs();
        return true;
index aa03b84a83bf6b717927c7d60a2deb44e4b0d5f2..596e66194917daa21cfc9b936b2fa619e64e7d8d 100644 (file)
@@ -336,7 +336,7 @@ private:
        /// Saves the settings of toolbars and all dialogs
        void saveUISettings() const;
        ///
-       bool restoreLayout();
+       bool restoreLayout(bool force_inittoolbars = false);
        ///
        GuiToolbar * toolbar(std::string const & name);
        ///