* 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
This commit is contained in:
Jürgen Spitzmüller 2009-06-30 11:00:16 +00:00
parent 7f163c0117
commit 7720592b2d

View File

@ -1527,6 +1527,9 @@ bool GuiApplication::readUIFile(QString const & name, bool include)
if (lyxerr.debugging(Debug::PARSER)) if (lyxerr.debugging(Debug::PARSER))
lex.printTable(lyxerr); lex.printTable(lyxerr);
// store which ui files define Toolbars
static QStringList toolbar_uifiles;
while (lex.isOK()) { while (lex.isOK()) {
switch (lex.lex()) { switch (lex.lex()) {
case ui_include: { case ui_include: {
@ -1546,6 +1549,7 @@ bool GuiApplication::readUIFile(QString const & name, bool include)
case ui_toolbars: case ui_toolbars:
d->toolbars_.readToolbarSettings(lex); d->toolbars_.readToolbarSettings(lex);
toolbar_uifiles.push_back(uifile);
break; break;
default: default:
@ -1566,9 +1570,12 @@ bool GuiApplication::readUIFile(QString const & name, bool include)
QFileInfo fi(uifiles[i]); QFileInfo fi(uifiles[i]);
QDateTime const date_value = fi.lastModified(); QDateTime const date_value = fi.lastModified();
QString const name_key = QString::number(i); 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).toString() != uifiles[i]
|| settings.value(name_key + "/date").toDateTime() != date_value) { || settings.value(name_key + "/date").toDateTime() != date_value)) {
touched = true; touched = true;
settings.setValue(name_key, uifiles[i]); settings.setValue(name_key, uifiles[i]);
settings.setValue(name_key + "/date", date_value); settings.setValue(name_key + "/date", date_value);