static QSet<Buffer const *> busyBuffers;
static docstring previewAndDestroy(Buffer const * orig, Buffer * buffer, string const & format);
static docstring exportAndDestroy(Buffer const * orig, Buffer * buffer, string const & format);
+ static docstring compileAndDestroy(Buffer const * orig, Buffer * buffer, string const & format);
static docstring saveAndDestroy(Buffer const * orig, Buffer * buffer, FileName const & fname);
// TODO syncFunc/previewFunc: use bind
#if (QT_VERSION >= 0x040400)
-docstring GuiView::GuiViewPrivate::exportAndDestroy(Buffer const * orig, Buffer * buffer, string const & format)
+docstring GuiView::GuiViewPrivate::compileAndDestroy(Buffer const * orig, Buffer * buffer, string const & format)
{
bool const update_unincluded =
buffer->params().maintain_unincluded_children
bool const success = buffer->doExport(format, true, update_unincluded);
delete buffer;
busyBuffers.remove(orig);
+ return success
+ ? bformat(_("Successful compilation to format: %1$s"), from_utf8(format))
+ : bformat(_("Error compiling format: %1$s"), from_utf8(format));
+}
+
+
+docstring GuiView::GuiViewPrivate::exportAndDestroy(Buffer const * orig, Buffer * buffer, string const & format)
+{
+ bool const update_unincluded =
+ buffer->params().maintain_unincluded_children
+ && !buffer->params().getIncludedChildren().empty();
+ bool const success = buffer->doExport(format, false, update_unincluded);
+ delete buffer;
+ busyBuffers.remove(orig);
return success
? bformat(_("Successful export to format: %1$s"), from_utf8(format))
: bformat(_("Error exporting to format: %1$s"), from_utf8(format));
d.asyncBufferProcessing(argument,
doc_buffer,
_("Exporting ..."),
- &GuiViewPrivate::exportAndDestroy,
+ &GuiViewPrivate::compileAndDestroy,
&Buffer::doExport,
0);
break;
d.asyncBufferProcessing(argument,
(doc_buffer ? doc_buffer->masterBuffer() : 0),
docstring(),
- &GuiViewPrivate::exportAndDestroy,
+ &GuiViewPrivate::compileAndDestroy,
&Buffer::doExport,
0);
break;