From: dmv Date: Tue, 14 Sep 2010 12:39:24 +0000 (+0000) Subject: IPAL20862 WinTC5.1.4: Not all the files are created in MultiFile mode. X-Git-Tag: mergeto_V5_1_main_04Oct10~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d7c84baeb775758b72b1bd096f3fc2b368347d6c;p=modules%2Fvisu.git IPAL20862 WinTC5.1.4: Not all the files are created in MultiFile mode. --- 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; }