On 12/03/2010 19:15, Pavel Sanda wrote:
Comments welcome, of course, but the main question is for Pavel: Can this
go now, or do you want me to wait?
i would wait. Abdel its possible to look at the error dialog which do not
appear anymore due to the buffer cloning?

Does this patch helps? (untested, sorry, no time here).

Abdel.

Index: Buffer.cpp
===================================================================
--- Buffer.cpp  (revision 33727)
+++ Buffer.cpp  (working copy)
@@ -3300,17 +3300,26 @@
        bool const success = theConverters().convert(this, FileName(filename),
                tmp_result_file, FileName(absFileName()), backend_format, 
format,
                error_list);
-       // Emit the signal to show the error list.
+
+       // Emit the signal to show the error list or copy it back to the
+       // cloned Buffer so that it cab be emitted afterwards.
        if (format != backend_format) {
-               errors(error_type);
+               if (d->cloned_buffer_) {
+                       d->cloned_buffer_->d->errorLists[error_type] = 
+                               d->errorLists[error_type];
+               } else 
+                       errors(error_type);
                // also to the children, in case of master-buffer-view
                std::vector<Buffer *> clist = getChildren();
                for (vector<Buffer *>::const_iterator cit = clist.begin();
-                    cit != clist.end(); ++cit)
-                       (*cit)->errors(error_type, true);
+                       cit != clist.end(); ++cit) {
+                       if (d->cloned_buffer_) {
+                               
(*cit)->d->cloned_buffer_->d->errorLists[error_type] = 
+                                       (*cit)->d->errorLists[error_type];
+                       } else
+                               (*cit)->errors(error_type, true);
+               }
        }
-       if (!success)
-               return false;
 
        if (d->cloned_buffer_) {
                // Enable reverse dvi or pdf to work by copying back the texrow
@@ -3318,8 +3327,13 @@
                // FIXME: There is a possibility of concurrent access to texrow
                // here from the main GUI thread that should be securized.
                d->cloned_buffer_->d->texrow = d->texrow;
+               string const error_type = bufferFormat();
+               d->cloned_buffer_->d->errorLists[error_type] = 
d->errorLists[error_type];
        }
 
+       if (!success)
+               return false;
+
        if (put_in_tempdir) {
                result_file = tmp_result_file.absFilename();
                return true;
Index: frontends/qt4/GuiView.cpp
===================================================================
--- frontends/qt4/GuiView.cpp   (revision 33727)
+++ frontends/qt4/GuiView.cpp   (working copy)
@@ -351,6 +351,8 @@
        ///
        QFutureWatcher<docstring> autosave_watcher_;
        QFutureWatcher<docstring> preview_watcher_;
+       ///
+       string last_export_format;
 #else
        struct DummyWatcher { bool isRunning(){return false;} }; 
        DummyWatcher preview_watcher_;
@@ -447,6 +449,7 @@
        QFutureWatcher<docstring> const * watcher =
                static_cast<QFutureWatcher<docstring> const *>(sender());
        message(watcher->result());
+       errors(d.last_export_format);
 #endif
 }
 
@@ -2824,6 +2827,7 @@
                        QFuture<docstring> f = 
QtConcurrent::run(exportAndDestroy,
                                doc_buffer->clone(), format);
                        d.setPreviewFuture(f);
+                       d.last_export_format = format;
 #else
                        bool const update_unincluded =
                                
doc_buffer->params().maintain_unincluded_children
@@ -2844,6 +2848,7 @@
                        QFuture<docstring> f = 
QtConcurrent::run(previewAndDestroy,
                                doc_buffer->clone(), format);
                        d.setPreviewFuture(f);
+                       d.last_export_format = format;
 #else
                        bool const update_unincluded =
                                
doc_buffer->params().maintain_unincluded_children
@@ -2863,6 +2868,7 @@
                        QFuture<docstring> f = 
QtConcurrent::run(exportAndDestroy,
                                master->clone(), format);
                        d.setPreviewFuture(f);
+                       d.last_export_format = format;
 #else
                        bool const update_unincluded =
                                master->params().maintain_unincluded_children
@@ -2880,6 +2886,7 @@
                        QFuture<docstring> f = 
QtConcurrent::run(previewAndDestroy,
                                master->clone(), format);
                        d.setPreviewFuture(f);
+                       d.last_export_format = format;
 #else
                        master->preview(format);
 #endif

Reply via email to