Create a new lyx file and insert an image. Any format will do, except
eps. Now try View->DVI. You will be informed that your format could
not be converted to eps and are suggested to define a proper converter.
However, after clicking OK, the dvi previewer is launched and you
can see your figure there, which indeed was perfectly converted to eps.

What happens here is that Qt caches file information, such that if
a FileName is constructed when the file doesn't still exist, Qt still
thinks it doesn't exist even when the file is later produced by the
converter.

I think this is done for performance reasons and propose the attached
patch. Note that Qt also provides a refresh() method that could be used
after performing an operation that may change the file status, but I
think that this would be too error prone. Then, maybe it would be
better to always disable caching, even for already existing files,
but I am not sure.

-- 
Enrico
Index: src/support/FileName.cpp
===================================================================
--- src/support/FileName.cpp    (revision 22110)
+++ src/support/FileName.cpp    (working copy)
@@ -60,7 +60,9 @@ struct FileName::Private
        Private() {}
 
        Private(string const & abs_filename) : fi(toqstr(abs_filename))
-       {}
+       {
+               fi.setCaching(fi.exists() ? true : false);
+       }
        ///
        QFileInfo fi;
 };

Reply via email to