]> git.lyx.org Git - features.git/commitdiff
Do not show master's errors if compiling child
authorScott Kostyshak <skostysh@lyx.org>
Sat, 7 Apr 2018 21:11:33 +0000 (17:11 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Sun, 8 Apr 2018 13:51:01 +0000 (09:51 -0400)
If a master document is compiled and has errors, and then a child is
compiled without error, the errors from the master compilation were
shown.

The setup of the relevant code is the following:

  processingThreadFinished() calls errors().  errors() makes the
  assumption that if it is called, there must have been an error
  somewhere.

The logic of the setup is the following:

  processingThreadFinished() knows whether there was an error on
  the most recent preview/export, although it doesn't know whether
  the error is from master or child (i.e. does not know whether the
  user was compiling the child, or whether master-buffer-view was
  called).  Inside error(), if there is no error in the child, it is
  assumed the error is from master.

For the above logic to work, errors() should only be called if there
was an error.

This commit fixes #11106 and preserves the fix to #7330.

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index efdd23edfdf2d55674a7134151ac41a11f7e3a16..acaa23486de489995de1c38e1fd163650256a9db 100644 (file)
@@ -725,7 +725,10 @@ void GuiView::processingThreadFinished()
                errors("Export");
                return;
        }
-       errors(d.last_export_format);
+       if (status != Buffer::ExportSuccess && status != Buffer::PreviewSuccess &&
+           status != Buffer::ExportCancel) {
+               errors(d.last_export_format);
+       }
 }
 
 
index 68f1734a94acb8708bfc02f726b152b27841b5bb..3ca4641ce0178cf4dd04a28662b6d963ca037d5b 100644 (file)
@@ -166,6 +166,9 @@ public:
        /// \name GuiBufferDelegate.
        //@{
        void resetAutosaveTimers();
+       // shows an error list (possibly master's)
+       // even if from_master is false, might show master's error list.
+       // this function should only be called if there was an error (#11106).
        void errors(std::string const &, bool from_master = false);
        void structureChanged();
        void updateTocItem(std::string const &, DocIterator const &);