The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 5e4e4b674c00bc546213d42258f19e13a2b28bc3
Author: Vincent van Ravesteijn <[email protected]>
Date:   Thu May 3 11:55:54 2012 +0200

    Always require a mask to get a temporary filename
    
    If no mask is supplied or the mask is attached to the end of the filename, 
we end up with unexpected names like
      <system-temp-dir>\lyx_tmpdir.qHp780.vcr780_<mask>
    instead of a temporary file in the lyx temporary directory like
      <system-temp-dir>\lyx_tmpdir.qHp780\<mask>.vcr780.

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index 4914afb..8b0142a 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -471,7 +471,7 @@ void putClipboard(ParagraphList const & paragraphs,
        // some kind of garbage collection there, or a shared_ptr, then this
        // would not be needed.
        static Buffer * buffer = theBufferList().newBuffer(
-               FileName::tempName().absFileName() + "_clipboard.internal");
+               FileName::tempName("clipboard.internal").absFileName());
        buffer->setUnnamed(true);
        buffer->paragraphs() = paragraphs;
        buffer->inset().setBuffer(*buffer);
diff --git a/src/LayoutFile.cpp b/src/LayoutFile.cpp
index 541f2da..39e0755 100644
--- a/src/LayoutFile.cpp
+++ b/src/LayoutFile.cpp
@@ -212,7 +212,7 @@ string layoutpost =
 
 LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
 {
-       FileName const tempLayout = FileName::tempName();
+       FileName const tempLayout = FileName::tempName("basic_layout");
        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.
diff --git a/src/frontends/qt4/GuiWorkArea.cpp 
b/src/frontends/qt4/GuiWorkArea.cpp
index f3b9cc8..4a5dae1 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -1415,7 +1415,7 @@ GuiView & GuiWorkArea::view()
 EmbeddedWorkArea::EmbeddedWorkArea(QWidget * w): GuiWorkArea(w)
 {
        buffer_ = theBufferList().newBuffer(
-               support::FileName::tempName().absFileName() + 
"_embedded.internal");
+               support::FileName::tempName("embedded.internal").absFileName());
        buffer_->setUnnamed(true);
        buffer_->setFullyLoaded(true);
        setBuffer(*buffer_);
diff --git a/src/support/FileName.h b/src/support/FileName.h
index 9d282e5..e1bc0de 100644
--- a/src/support/FileName.h
+++ b/src/support/FileName.h
@@ -174,7 +174,7 @@ public:
        /// \p mask must be in filesystem encoding, if it contains a
        /// relative path, the template file will be created in the global
        /// temporary directory as given by 'package().temp_dir()'.
-       static FileName tempName(std::string const & mask = empty_string());
+       static FileName tempName(std::string const & mask);
        static FileName tempName(FileName const & temp_dir,
                std::string const & mask);
 

-----------------------------------------------------------------------

Summary of changes:
 src/CutAndPaste.cpp               |    2 +-
 src/LayoutFile.cpp                |    2 +-
 src/frontends/qt4/GuiWorkArea.cpp |    2 +-
 src/support/FileName.h            |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to