From 7720592b2dfbd733302d16c84a2d596ab9342474 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 30 Jun 2009 11:00:16 +0000 Subject: [PATCH] * GuiApplication.cpp (readUiFiles): - only reset settings if a file with Toolbars has changed. This should significantly decrease the number of circumstances where the settings are lost unnecessarily. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30317 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiApplication.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index cdee48bfbd..f37e5b9835 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1527,6 +1527,9 @@ bool GuiApplication::readUIFile(QString const & name, bool include) if (lyxerr.debugging(Debug::PARSER)) lex.printTable(lyxerr); + // store which ui files define Toolbars + static QStringList toolbar_uifiles; + while (lex.isOK()) { switch (lex.lex()) { case ui_include: { @@ -1546,6 +1549,7 @@ bool GuiApplication::readUIFile(QString const & name, bool include) case ui_toolbars: d->toolbars_.readToolbarSettings(lex); + toolbar_uifiles.push_back(uifile); break; default: @@ -1566,9 +1570,12 @@ bool GuiApplication::readUIFile(QString const & name, bool include) QFileInfo fi(uifiles[i]); QDateTime const date_value = fi.lastModified(); QString const name_key = QString::number(i); - if (!settings.contains(name_key) + // if an ui file which defines Toolbars has changed, + // we have to reset the settings + if (toolbar_uifiles.contains(uifiles[i]) + && (!settings.contains(name_key) || settings.value(name_key).toString() != uifiles[i] - || settings.value(name_key + "/date").toDateTime() != date_value) { + || settings.value(name_key + "/date").toDateTime() != date_value)) { touched = true; settings.setValue(name_key, uifiles[i]); settings.setValue(name_key + "/date", date_value); -- 2.39.2