From d7c84baeb775758b72b1bd096f3fc2b368347d6c Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 14 Sep 2010 12:39:24 +0000 Subject: [PATCH] IPAL20862 WinTC5.1.4: Not all the files are created in MultiFile mode. --- src/VISU_I/VISU_ResultUtils.cc | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/VISU_I/VISU_ResultUtils.cc b/src/VISU_I/VISU_ResultUtils.cc index 55b14d55..ea918c29 100644 --- a/src/VISU_I/VISU_ResultUtils.cc +++ b/src/VISU_I/VISU_ResultUtils.cc @@ -649,16 +649,36 @@ namespace VISU CopyFile(const std::string& theSourceFileName, const std::string& theTargetFileName) { - QFileInfo aSourceFileInfo(theSourceFileName.c_str()); - QFileInfo aTargetFileInfo(theTargetFileName.c_str()); + QString aSourcePath = theSourceFileName.c_str(); +#ifdef WNT + aSourcePath.replace( QString("/"), QString("\\") ); + int prevSlash = 0; + for ( int ind = 0; ind < aSourcePath.length(); ind ++ ) + { + if ( aSourcePath.at( ind ) == '\\' ) + prevSlash = ind; + if ( aSourcePath.at( ind ) == ' ' ) + { + int nextSlash = aSourcePath.indexOf( '\\', ind); + if ( aSourcePath.at( nextSlash - 1 ) != '"' ) + { + aSourcePath.insert( nextSlash, '"'); + aSourcePath.insert( prevSlash + 1, '"'); + ind++; + } + } + } +#endif + + QFileInfo aSourceFileInfo( aSourcePath ); + QFileInfo aTargetFileInfo( theTargetFileName.c_str() ); if(aSourceFileInfo.absoluteFilePath() == aTargetFileInfo.absoluteFilePath()) return true; QString aCommand; - aCommand.sprintf("%s %s %s", - COPY_COMMAND, - aSourceFileInfo.filePath().toLatin1().data(), - aTargetFileInfo.filePath().toLatin1().data()); + aCommand.sprintf("%s %s %s", COPY_COMMAND, + aSourcePath.toLatin1().data(), + theTargetFileName.c_str()); return system(aCommand.toLatin1().data()) == 0; } -- 2.39.2