+
+#else
+
+// not used, but the linker needs them
+
+docstring GuiView::GuiViewPrivate::compileAndDestroy(
+ Buffer const *, Buffer *, string const &)
+{
+ return docstring();
+}
+
+
+docstring GuiView::GuiViewPrivate::exportAndDestroy(
+ Buffer const *, Buffer *, string const &)
+{
+ return docstring();
+}
+
+
+docstring GuiView::GuiViewPrivate::previewAndDestroy(
+ Buffer const *, Buffer *, string const &)
+{
+ return docstring();
+}
+
+#endif
+
+
+bool GuiView::GuiViewPrivate::asyncBufferProcessing(
+ string const & argument,
+ Buffer const * used_buffer,
+ docstring const & msg,
+ docstring (*asyncFunc)(Buffer const *, Buffer *, string const &),
+ bool (Buffer::*syncFunc)(string const &, bool, bool) const,
+ bool (Buffer::*previewFunc)(string const &, bool) const)
+{
+ if (!used_buffer)
+ return false;
+
+ string format = argument;
+ if (format.empty())
+ format = used_buffer->getDefaultOutputFormat();
+
+#if EXPORT_in_THREAD && (QT_VERSION >= 0x040400)
+ if (!msg.empty()) {
+ progress_->clearMessages();
+ gv_->message(msg);
+ }
+ GuiViewPrivate::busyBuffers.insert(used_buffer);
+ QFuture<docstring> f = QtConcurrent::run(
+ asyncFunc,
+ used_buffer,
+ used_buffer->clone(),
+ format);
+ setPreviewFuture(f);
+ last_export_format = used_buffer->bufferFormat();
+ (void) syncFunc;
+ (void) previewFunc;
+ // We are asynchronous, so we don't know here anything about the success
+ return true;
+#else
+ if (syncFunc) {
+ // TODO check here if it breaks exporting with Qt < 4.4
+ bool const update_unincluded =
+ used_buffer->params().maintain_unincluded_children &&
+ !used_buffer->params().getIncludedChildren().empty();
+ return (used_buffer->*syncFunc)(format, true, update_unincluded);
+ } else if (previewFunc) {
+ return (used_buffer->*previewFunc)(format, false);
+ }
+ (void) asyncFunc;
+ return false;