mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
* 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:
parent
7f163c0117
commit
7720592b2d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user