From 390ae05444cf4899a3028dcbbfe1095ecd2d207a Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Sun, 19 Apr 2015 02:30:28 -0400 Subject: [PATCH] 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. --- src/BufferList.cpp | 9 +++++++++ src/BufferList.h | 2 ++ src/frontends/qt4/GuiPrefs.cpp | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/BufferList.cpp b/src/BufferList.cpp index c253282b79..68a1e808cb 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 4f9cb95c05..242eff03be 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 df0675a4a2..9b6025ef8b 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)); -- 2.39.2