]> git.lyx.org Git - lyx.git/commitdiff
* GuiApplication.cpp (readUiFiles):
authorJürgen Spitzmüller <spitz@lyx.org>
Tue, 30 Jun 2009 11:00:16 +0000 (11:00 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Tue, 30 Jun 2009 11:00:16 +0000 (11:00 +0000)
- 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

index cdee48bfbd8c4101bd8d2c5630a6e908a072ed21..f37e5b9835a1306cfa63491e05e02c11c55877a1 100644 (file)
@@ -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);