commit 390ae05444cf4899a3028dcbbfe1095ecd2d207a
Author: Scott Kostyshak <[email protected]>
Date: Sun Apr 19 02:30:28 2015 -0400
Update previews on preference change (#9507)
Normally the theBufferList().updatePreviews(); statement would go inside
of PrefDisplay::applyRC. However, that would not work well because
Buffer::updatePreviews() calls loader() which conditions on
(lyxrc.preview == LyXRC::PREVIEW_OFF) but the new RC has not been set at
this point.
diff --git a/src/BufferList.cpp b/src/BufferList.cpp
index c253282..68a1e80 100644
--- a/src/BufferList.cpp
+++ b/src/BufferList.cpp
@@ -344,6 +344,15 @@ void BufferList::recordCurrentAuthor(Author const & author)
}
+void BufferList::updatePreviews()
+{
+ BufferStorage::iterator it = bstore.begin();
+ BufferStorage::iterator end = bstore.end();
+ for (; it != end; ++it)
+ (*it)->updatePreviews();
+}
+
+
int BufferList::bufferNum(FileName const & fname) const
{
FileNameList const buffers(fileNames());
diff --git a/src/BufferList.h b/src/BufferList.h
index 4f9cb95..242eff0 100644
--- a/src/BufferList.h
+++ b/src/BufferList.h
@@ -115,6 +115,8 @@ public:
//@{
/// reset current author for all buffers
void recordCurrentAuthor(Author const & author);
+ /// update previews for all buffers, e.g. for Prefs update
+ void updatePreviews();
/// Call changed() on all buffers, internal or not
void changed(bool update_metrics) const;
/// emergency save for all buffers
diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp
index df0675a..9b6025e 100644
--- a/src/frontends/qt4/GuiPrefs.cpp
+++ b/src/frontends/qt4/GuiPrefs.cpp
@@ -3456,6 +3456,8 @@ void GuiPreferences::dispatchParams()
update_screen_font_ = false;
}
+ theBufferList().updatePreviews();
+
// The Save button has been pressed
if (isClosing())
dispatch(FuncRequest(LFUN_PREFERENCES_SAVE));