One more fix to avoid loss of data

This commit is contained in:
wmayer
2013-05-06 12:27:25 +02:00
parent 62710779a7
commit 50559c4b17
2 changed files with 13 additions and 1 deletions

View File

@@ -153,6 +153,12 @@ void PropertyFileIncluded::setValue(const char* sFile, const char* sName)
_BaseFileName = file.fileName();
}
// That's wrong and can lead to loss of data!!!
// Just consider the example that two objects with this property
// exist in the same document and as an initial step the data are
// copied from one object to the other. A rename will cause the one
// object to loose its data.
#if 0
// if the file is already in transient dir of the document, just use it
if (path == pathTrans) {
bool done = file.renameFile(_cValue.c_str());
@@ -163,7 +169,9 @@ void PropertyFileIncluded::setValue(const char* sFile, const char* sName)
}
}
// otherwise copy from origin location
else {
else
#endif
{
// if file already exists in transient dir make a new unique name
Base::FileInfo fi(_cValue);
if (fi.exists()) {