]> git.lyx.org Git - lyx.git/blobdiff - src/LayoutFile.cpp
Update previews on preference change (#9507)
[lyx.git] / src / LayoutFile.cpp
index 8ec7474a0a3673be826d90cb1a3efedee0d5a4a0..e428b5d76f860e932e2d44906862925ddfd8bd03 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "support/bind.h"
 #include "support/regex.h"
+#include "support/TempFile.h"
 
 #include <fstream>
 
@@ -224,8 +225,9 @@ string layoutpost =
 LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
 {
        // FIXME This could be simplified a bit to call TextClass::read(string, ReadType).
-       
-       FileName const tempLayout = FileName::tempName("basic_layout");
+
+       TempFile tempfile("basicXXXXXX.layout");
+       FileName const tempLayout = tempfile.name();
        ofstream ofs(tempLayout.toFilesystemEncoding().c_str());
        // This writes a very basic class, but it also attempts to include 
        // stdclass.inc. That would give us something moderately usable.