]> git.lyx.org Git - features.git/commitdiff
Update previews on preference change (#9507)
authorScott Kostyshak <skostysh@lyx.org>
Sun, 19 Apr 2015 06:30:28 +0000 (02:30 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Tue, 21 Apr 2015 06:40:18 +0000 (02:40 -0400)
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
src/BufferList.h
src/frontends/qt4/GuiPrefs.cpp

index c253282b795c029ea244769362d4fee5d9e6ca5c..68a1e808cb07ab98672b4f5a49185e7dba0f4f05 100644 (file)
@@ -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());
index 4f9cb95c05cb6d177aa3637ed9a8a01bfebe5832..242eff03bea24d34d5750b670bd9511767055b64 100644 (file)
@@ -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
index df0675a4a2b635889aa4bf28708a23287cec0dea..9b6025ef8bbf5bb615b5dbd6708bae6adec70d20 100644 (file)
@@ -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));