From: Abdelrazak Younes Date: Wed, 23 Jul 2008 09:41:26 +0000 (+0000) Subject: Add masks to temp file names, easier for debugging in case of crash. X-Git-Tag: 1.6.10~3913 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=794aa69fc76458611877b273896b883c9561cf6b;p=features.git Add masks to temp file names, easier for debugging in case of crash. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25832 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index b38a394b48..44e7b62a4c 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -648,7 +648,7 @@ bool Buffer::readString(string const & s) Lexer lex; istringstream is(s); lex.setStream(is); - FileName const name = FileName::tempName(); + FileName const name = FileName::tempName("Buffer_readString"); switch (readFile(lex, name, true)) { case failure: return false; @@ -737,7 +737,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename, // lyx2lyx would fail return wrongversion; - FileName const tmpfile = FileName::tempName(); + FileName const tmpfile = FileName::tempName("Buffer_readFile"); if (tmpfile.empty()) { Alert::error(_("Conversion failed"), bformat(_("%1$s is from a different" diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 2e5087f313..3f756bdd49 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -222,7 +222,7 @@ namespace { bool TextClass::convertLayoutFormat(support::FileName const & filename, ReadType rt) { LYXERR(Debug::TCLASS, "Converting layout file to " << FORMAT); - FileName const tempfile = FileName::tempName(); + FileName const tempfile = FileName::tempName("convert_layout"); bool success = layout2layout(filename, tempfile); if (success) success = read(tempfile, rt); @@ -285,10 +285,10 @@ bool TextClass::read(std::string const & str, ReadType rt) return retval == OK; // write the layout string to a temporary file - FileName const tempfile = FileName::tempName(); + FileName const tempfile = FileName::tempName("TextClass_read"); ofstream os(tempfile.toFilesystemEncoding().c_str()); if (!os) { - LYXERR0("Unable to create tempoary file"); + LYXERR0("Unable to create temporary file"); return false; } os << str;