+ fixes #0001238: Preferences: set temp files directory

This commit is contained in:
wmayer
2015-09-19 16:07:33 +02:00
parent 718b766737
commit ef203bc260
10 changed files with 44 additions and 10 deletions

View File

@@ -43,6 +43,7 @@
#include <Base/FileInfo.h>
#include <Base/TimeInfo.h>
#include <Base/Console.h>
#include <App/Application.h>
#include <Mod/Mesh/App/Core/MeshKernel.h>
#include <Mod/Mesh/App/Core/Evaluation.h>
@@ -1125,7 +1126,7 @@ void FemMesh::Restore(Base::XMLReader &reader)
void FemMesh::SaveDocFile (Base::Writer &writer) const
{
// create a temporary file and copy the content to the zip stream
Base::FileInfo fi(Base::FileInfo::getTempFileName().c_str());
Base::FileInfo fi(App::Application::getTempFileName().c_str());
myMesh->ExportUNV(fi.filePath().c_str());
@@ -1154,7 +1155,7 @@ void FemMesh::SaveDocFile (Base::Writer &writer) const
void FemMesh::RestoreDocFile(Base::Reader &reader)
{
// create a temporary file and copy the content from the zip stream
Base::FileInfo fi(Base::FileInfo::getTempFileName().c_str());
Base::FileInfo fi(App::Application::getTempFileName().c_str());
// read in the ASCII file and write back to the file stream
Base::ofstream file(fi, std::ios::out | std::ios::binary);

View File

@@ -51,6 +51,7 @@
#include <Base/Exception.h>
#include <Base/FileInfo.h>
#include <Base/Stream.h>
#include <App/Application.h>
#include <App/DocumentObject.h>
#include "PropertyTopoShape.h"
@@ -277,7 +278,7 @@ void PropertyPartShape::SaveDocFile (Base::Writer &writer) const
// create a temporary file and copy the content to the zip stream
// once the tmp. filename is known use always the same because otherwise
// we may run into some problems on the Linux platform
static Base::FileInfo fi(Base::FileInfo::getTempFileName());
static Base::FileInfo fi(App::Application::getTempFileName());
if (!BRepTools::Write(myShape,(const Standard_CString)fi.filePath().c_str())) {
// Note: Do NOT throw an exception here because if the tmp. file could
@@ -330,7 +331,7 @@ void PropertyPartShape::RestoreDocFile(Base::Reader &reader)
BRep_Builder builder;
// create a temporary file and copy the content from the zip stream
Base::FileInfo fi(Base::FileInfo::getTempFileName());
Base::FileInfo fi(App::Application::getTempFileName());
// read in the ASCII file and write back to the file stream
Base::ofstream file(fi, std::ios::out | std::ios::binary);