- foreach ( const QString& aFileName, aFileNames ) {
- if ( !HYDROData_Profile::ImportFromFile( doc(), qPrintable( aFileName ) ) ) {
- aBadImportedFiles += aFileName + "\n";
+ int aTotalNbImported = 0;
+
+ foreach ( const QString& aFileName, aFileNames )
+ {
+ NCollection_Sequence<int> aBadProfilesIds;
+ TCollection_AsciiString anAsciiFileName = HYDROGUI_Tool::ToAsciiString( aFileName );
+
+ int aNbImported = HYDROData_Profile::ImportFromFile( doc(), anAsciiFileName, aBadProfilesIds );
+ if ( aNbImported == 0 || !aBadProfilesIds.IsEmpty() )
+ {
+ aBadImportedFiles += QFileInfo( aFileName ).fileName();
+ if ( !aBadProfilesIds.IsEmpty() && aNbImported > 0 )
+ {
+ aBadImportedFiles += ", " + tr( "BAD_PROFILE_IDS" ) + " : ";
+ for ( int i = 1, n = aBadProfilesIds.Length(); i <= n; ++i )
+ aBadImportedFiles += QString::number( aBadProfilesIds.Value( i ) ) + ", ";
+ aBadImportedFiles.remove( aBadImportedFiles.length() - 2, 2 );
+ }
+ aBadImportedFiles += ";\n";