Converter: add a safe guard to Alerts because those cannot be called from another thread. The whole Alert system must be rethought I am afraid.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32585 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2009-12-18 22:59:59 +00:00
parent 4ed0169064
commit bea0925f8c
3 changed files with 10 additions and 2 deletions

View File

@ -375,6 +375,12 @@ Buffer * Buffer::clone() const
} }
bool Buffer::isClone() const
{
return d->cloned_buffer_;
}
void Buffer::changed() const void Buffer::changed() const
{ {
if (d->wa_) if (d->wa_)

View File

@ -133,6 +133,8 @@ public:
/// ///
Buffer * clone() const; Buffer * clone() const;
///
bool isClone() const;
/** High-level interface to buffer functionality. /** High-level interface to buffer functionality.
This function parses a command string and executes it. This function parses a command string and executes it.

View File

@ -608,13 +608,13 @@ bool Converters::runLaTeX(Buffer const & buffer, string const & command,
buffer.bufferErrors(terr, errorList); buffer.bufferErrors(terr, errorList);
// check return value from latex.run(). // check return value from latex.run().
if ((result & LaTeX::NO_LOGFILE)) { if ((result & LaTeX::NO_LOGFILE) && !buffer.isClone()) {
docstring const str = docstring const str =
bformat(_("LaTeX did not run successfully. " bformat(_("LaTeX did not run successfully. "
"Additionally, LyX could not locate " "Additionally, LyX could not locate "
"the LaTeX log %1$s."), from_utf8(name)); "the LaTeX log %1$s."), from_utf8(name));
Alert::error(_("LaTeX failed"), str); Alert::error(_("LaTeX failed"), str);
} else if (result & LaTeX::NO_OUTPUT) { } else if ((result & LaTeX::NO_OUTPUT) && !buffer.isClone()) {
Alert::warning(_("Output is empty"), Alert::warning(_("Output is empty"),
_("An empty output file was generated.")); _("An empty output file was generated."));
} }